Forum Discussion

Mike_Moniz's avatar
Mike_Moniz
Icon for Professor rankProfessor
2 months ago

Active Discover Filters with non-existent properties

I've been looking for an easy way to exclude instances by manually creating properties like ##exclude.volumes## or ##exclude.replicationjobs## which can be referenced in Active Discovery filters. Normally you can use something like NotContain or RegexNotMatch (ie "Name NotContain ##exclude.volumes##") but that only works if the property exists. If it doesn't existing (which provides an empty string) then that filter ends up excluding everything. Which means you can't just add it when you need to exclude something. I tried several different ways to write regex to make this work but I don't think it's possible (but open to hearing a way!).

Note that this needs to account for instances that can change automatically, like temporary drive mounts for example. So just disabling the instances manually wouldn't be enough. I also don't really want to set a "default" value for all these possible Exclude properties at the root level. I also wanted something that can be easily modified on any existing multi-instance DataSources, including common built-in ones and DataSources that just use WMI or SNMP without scripting. I could clone the existing DataSource and switch to using a scripted Active Discovery to deal with it in code. But I already have so many parallel DataSources with official ones and a simple Filter change would be better.

So what I would like to see, and I'm sure it's come up before, is for Active Discover filters to support nested AND. So a filter can contain something like (##exclude.volumes## Exists AND Name RegexNotMatch ##exclude.volumes##). That should provide a way to do what I'm looking to do. Or something that might be easier but messier is a new option like NotContainUnlessBlank or similar that will ignore values that are blank, although that sounds messy and confusing.

I'm open to any suggestions to workaround if anyone has any.

8 Replies

  • skydonnell's avatar
    skydonnell
    Icon for Community Manager rankCommunity Manager

    Hi Mike,

    I've sent this over to the Product team as a feature request, and I will also share it directly with our Product Managers to see if anyone has a workaround for you. 

  • I'm not sure of any good way to do this, and I haven't heard of anyone asking for this explicitly around AD filters, though I'm sure others have requested other ways to exclude instances from monitoring.

    I could envision having a standard setup for this, so that all you have to do is apply a property in an expected format (DS Name, instance wildaliases or wildvalues).

  • The deprecated snmp64_If- kinda sorta attempts something like this by having an alert_enable property and putting Groovy code directly into the datapoint for Status. So it can return a different value if the instance should alert or not. But I'm looking to exclude the whole instance rather then if it alerts or not, and without a major rewrite.

     

  • mray's avatar
    mray
    Icon for LM Conqueror rankLM Conqueror

    Mike_Moniz​ Does it need to be regex? or would a list of values work? asking bc the EventSource "Windows System Event Log" does almost what you're talking about but uses "Not In" for the filter. I would need to test that though to see if it would even work for instance discovery

  • For my use case that would work if it was implemented the same as EventSources. So something like using NotIn "C:\Users\|C:\VeeamFLR\" would exclude drives mounted into C:\Users\* or C:\VeeamFLR\* for example. But NotIn "" wouldn't cause AD to exclude everything.

    • mray's avatar
      mray
      Icon for LM Conqueror rankLM Conqueror

      hmm I guess prob feedback, but that kinda sounds worth a support ticket. I would think the platform should be smart enough to ignore the filter if the prop is not present. 

      Only other thing would be to just do scripted discovery but I know that's not what you're looking to do

  • OK, so this is a complete bodge / kludge, but what if you set the "exclude.volumes" (etc) property/properties at a high group level so it exists on all relevant resources by inheritance? (E.g. at "Devices by Type/Windows Servers" or equivalent)

    The value can either be blank (if that works - TEST FIRST!) or a value that is never going to match a real instance name and therefore never going to exclude anything.

    You're then free to add subgroup or resource-specific values to the same prop name, where appropriate, to target those specifics you don't want.

    • Mike_Moniz's avatar
      Mike_Moniz
      Icon for Professor rankProfessor

      Yeah, adding all the exclude properties to the root group with a value that will never match should work (empty value will not). But then I would need to add ALL the exclude properties I create (which can grow over time) to the group and would be applied to each device. It is a kludge I would like to avoid, but should work.

      It would just be nice to have something like the No* categories (like NoPing, NoSnmpIf, etc) where you can just apply it when needed. Just that this would be for Instances instead of whole DataSources.