Forum Discussion

Dave_Lee's avatar
Dave_Lee
Icon for Advisor rankAdvisor
10 months ago
Solved

Excluding VMware VMs from instance discovery

When we add a vCenter into Logic Monitor, the VMs in it’s managed clusters are discovered as instances of underneath datasources applied to the vCenter, like:

VMware VM Status
VMware VM Snapshots
VMware VM Performance

Sometimes there are VMs that we have no interest in monitoring, so we don’t want them to be picked up by these datasources.  At the moment, we’re manually adding an Instance Group, putting those VMs in the group and then disabling alerts, which is quite a manual process.

Ideally we’d like LM to not discover VMs that have had a specific tag/value applied to them in vCenter.  I think we should be able to do this by modifying the Groovy script used for Active Discovery on these data sources, but I’m not sure how to go about that.

Has anyone managed to do something similar?

Dave

  • Thanks @tswisdom - I think Active Discovery Filters is just what I’m looking for here.  Looking through the Active Discovery script for the VMware_vCenter_VMStatus datasource, it look as though that should be returning tags in it’s output, but doesn’t seem to be doing so.  I’ll have to dig a little deeper into that, then look at the Active Discovery Filters.

    thanks

    Dave

16 Replies

  • Yessss i Love your work :) Totally a Fan! hehehehe i should have put a mention to you in it sorry for that. BTW i use your filtering theory across many datasources so thank you for that ❤

  • This is how i handle that kind of filtering using a property. 

    Love to see my stuff in action.

  • This is how i handle that kind of filtering using a property. 

  • I realised that I needed to put the customproperty esx.tags=true on the vCenter Server, for the Active Discovery script to return the tags on each VM.  That’s working now.

    I’m trying to understand how to best use the Active Discovery Filters.  Ideally I want to exclude any instance that has the tag “exclude” in the “monitoring” category.  This comes through in the properties as

    auto.monitoring:exclude;

    I’ve setup the filter as follows:

    Which excludes the instance that I’ve put the tag on, but also includes all other instances.  It seems that, if the instance doesn’t have an “auto.monitoring” property, then it gets filtered out as well.

    The following does work, but I think this will exclude an instance that has ANY value for auto.monitoring - so if a VM has other tags in the “monitoring” category then it will get filtered out.


    Is there any way to set the Auto Discovery Filter so that it only returns items where “auto.monitoring” is not “exclude” but allows any that have to “auto.monitoring” property set at all?

    Dave

  • Thanks @tswisdom - I think Active Discovery Filters is just what I’m looking for here.  Looking through the Active Discovery script for the VMware_vCenter_VMStatus datasource, it look as though that should be returning tags in it’s output, but doesn’t seem to be doing so.  I’ll have to dig a little deeper into that, then look at the Active Discovery Filters.

    thanks

    Dave

  • Good afternoon @Dave Lee,

    While our enhanced netscan script for adding VMWare resources allows you to leverage several filters to exclude VM’s and other components, the datasources for various VMWare resources do not currently include native filtering.

    With that said, there are two approaches you could take to automate how instances are handled.

    The first would be as you suggested, modifying the Active Discovery script to pull tags or other items you wish to key off of, then configuring Active Discovery Filters to exclude instances based off of the data.

    Alternatively, you can configure your alert rules to only match, or exclude, particular instances for these modules, routing some but not others.