Antony Hawkins

DataSources_List PropertySource

Recommended Posts

Q: What does it do?

A: Calls the LogicMonitor API and finds, for each applicable device, a list of DataSource Names that exist on the Device, i.e. have at least one instance. This also includes ConfigSources active on the Device. These are put together as a semicolon-seperated list in the property auto.activedatasources:


Q: Why? I can just look at the Device in the Device tree.

A: You can, but... This PropertySource means you can create Dynamic Groups and Device Inventory Reports based on the presence or absence of *any* combination of DataSources on Devices.

Q: Can you give me a real-world example of this being useful?

A: Yes. On a Microsoft SQL server, LogicMonitor will find the SQL Services via WMI, but the actual SQL Server metrics are found via Perfmon or JDBC methods. If we can't access Perfmon or JDBC for any reason (required services not running, lack of credentials, etc) we'll be missing the SQL stats but quite probably getting all the other Windows metrics (via WMI). This can be very difficult to spot if you have one affected SQL server out of 1,000.

With this PropertySource running, you could create a Dynamic Group with a custom query of:

auto.ActiveDataSources =~ "WinSQLServices-" && auto.ActiveDataSources !~ "WinSQLServer-" && auto.ActiveDataSources !~ "WinSQLServer_JDBC-"

This will list all the devices on which we've found SQL Services but have failed to find any SQL metrics.

Similarly Exchange Services are discovered via WMI, whilst most Exchange metrics come from Perfmon.

Or, maybe you want to create a Group to contain all your Linux servers that are running Apache web server and MySQL:

isLinux() && auto.ActiveDataSources =~ "Apache-" && auto.ActiveDataSources =~ "Mysql-"

You will need:

A REST API Access ID and Access Key for a user with permissions to at least view all Devices within the account (or all Devices in whichever Groups you wish to consider). These should be set as properties 'apiaccessid.key' and 'apiaccesskey.key' within the Devices tree (generally the root level, or a Group level if appropriate).

The PropertySource will use these to find the list of DataSources present on the Device, and create the auto.activedatasources property for all devices.

auto.activedatasources will have one of two error messages if the required API details are not present or do not give sufficient access to query the Device; this could of course also be used to create Dynamic Groups and in Device Inventory Reports.

Note that DataSources are listed by their (unique) 'Name' rather than their (not necessarily unique) 'Displayed As' string seen in the Device tree.

v1.0.0: ZLTDWM

Current limitations:

The fields are limited to 2,000 characters, so if the list of DataSource Names exceeds this size, the data will be truncated. This is likely to be an edge case only seen on test Devices with multiple custom DataSources applied.

Auto Properties are updated daily or when Active Discovery is run for a Device, so there may (will!) be a time lag between DataSources being applied to a Device and those DataSources appearing in this auto.activedatasources property list.

Edited by Antony Hawkins

Share this post

Link to post
Share on other sites

This wasn't working for us, I think we ran into a bug somewhere where uppercase property sources weren't working, i set them to lowercase in this one and it started working. not sure why that was an issue though, i've got other datasources that i believe i have uppercase letters in. just an fyi. this is great though, will use this in our dynamic grouping applies to functions. 

Share this post

Link to post
Share on other sites

Thanks Tom, good to know it's already being useful!

Did you modify the output with '.toLowerCase()' or similar, or was there more to it?



Share this post

Link to post
Share on other sites

@Antony Hawkins i just modified the pair values to be lowercase. the upper case response was fine, it was just the "auto.propertyname" that couldn't be "auto.PropertyName", very odd behavior, but that caused issues for some reason. 

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.