Forum Discussion

PDR_BM's avatar
23 days ago
Solved

Created custom properties when discovering devices

I'm trying to automate our onboarding process of resources a bit more because at the moment we are wasting a lot of time with custom properties and dynamic groups.

We are mainly working with dynamic groups that look at custom properties on the resource (Location of the resources, application the resources is used for, PRD or TST, etc ...) to decide which resources they have to use . Now because dynamic groups don't support inherited properties this creates a situation where we have to manually add these custom properties for each resource.

Is there a way to add these properties during the Netscan? Because we know that resources in a certain ip range are linked to a certain site/application/... 

Any other solutions to automate this as much as possible are also appreciated. 

  • I've not used Netscans much but thought it seemed like a fair straight forward requirement - putting some custom properties on a device discovered by a Netscan.  I can't see an option to do it though.  A scripted custom netscan would do it, but seems overkill having to write a groovy script to scan a range and discover devices so you can add some custom properties.

    Another option.. you could write some really simple property sources that output static values for the properties (like the location, application) and apply them based on the contents of system.ips.

    LM provide this example in the AppliesTo documentation (https://www.logicmonitor.com/support/terminology-syntax/scripting-support/what-is-lms)  so you could use this to set the applies to on each of your property sources

    join(system.ips,",")=~"192\\.168\\.100\\."

    Matches resources with an IP address on the subnet 192.168.100.X. The ability to match on the partial IP address of a resource is useful for grouping devices by 

    Then you need a script that writes out the properties you need, you could make those static, something like

    println "application=finance"
    println "location=london-datacentre"

2 Replies

  • I tried it out and PropertySources are working fine for what I need. Thank you for the info!

  • I've not used Netscans much but thought it seemed like a fair straight forward requirement - putting some custom properties on a device discovered by a Netscan.  I can't see an option to do it though.  A scripted custom netscan would do it, but seems overkill having to write a groovy script to scan a range and discover devices so you can add some custom properties.

    Another option.. you could write some really simple property sources that output static values for the properties (like the location, application) and apply them based on the contents of system.ips.

    LM provide this example in the AppliesTo documentation (https://www.logicmonitor.com/support/terminology-syntax/scripting-support/what-is-lms)  so you could use this to set the applies to on each of your property sources

    join(system.ips,",")=~"192\\.168\\.100\\."

    Matches resources with an IP address on the subnet 192.168.100.X. The ability to match on the partial IP address of a resource is useful for grouping devices by 

    Then you need a script that writes out the properties you need, you could make those static, something like

    println "application=finance"
    println "location=london-datacentre"