ContributionsMost RecentMost LikesSolutionsRe: Xpath woes Support was able to get me going on this. Not sure why but this is the syntax that works: /*[local-name()='GetValue']/*[local-name()='return'] And, to follow up on my own question, LM has no problem dealing with non-integer (decimal) values. @LMjosephBrett thanks for your help with getting this solved! Re: Xpath woes Thanks @LMjosephBrett and sorry about the delayed response. Ticket created; DM sent. Xpath woes Hey all, Been trying to figure out why this Xpath syntax is not working and I’m at a point where it seems like it’s an issue specific to LM…hoping someone knows of a fix/workaround. Abridged XML response that I’m getting from a device we want to monitor: <?xml version="1.0" ?> <BACrest:GetValue xmlns:BACrest="urn:BACrestService"> [...] <BACrest:return>75.034996</BACrest:return> </BACrest:GetValue > I’m trying to get the value insideBACrest:return. Using the XML section of this article as reference. Also using freeformatter.com as suggested here to validate my Xpath syntax. I’ve tried a bunch of various syntax options that all work largely as expected in freeformatter but don’t work in LM: I get either NaN or 0. I have verified that I’m getting the expected XML in the body of the response. Various syntaxes I’ve tried: BACrest:GetValue/BACrest:return /BACrest:GetValue/BACrest:return /BACrest:GetValue/BACrest:return/text() number(/BACrest:GetValue/BACrest:return) string(/BACrest:GetValue/BACrest:return) ...etc. Then I thought maybe LM needs to have an integer (is that a thing?) so I tried this: substring-before(/BACrest:GetValue/BACrest:return, '.') ...which returns just 75 in freeformatter. Ideas? Thanks! SolvedRe: JSON Path capability in a Webpage DataSource Thanks for the input @Isaac Paramo and @Stuart Weenig . Going to give this a go in the near future. JSON Path capability in a Webpage DataSource I think the answer to this is gonna be “You need to script it, dummy”, but figured I’d check anyway... I'm working on a new DataSource that pulls/interprets JSON data from a peudo-custom system via HTTP. The system has a status page that lists the status of various components using JSON elements that have this general format: ParameterName&ParameterType Initial idea was that I could use the Webpage collector since it supports JSON/BSON parsing. Issue I’m running into is that the values on most of these JSON elements are string (i.e. “true”/”false”). I set up a DataPoint that can extract that value by putting in the JSON Path like so: $.[##WILDVALUE##].[ParameterName&ParameterType] ...and I can see that I’m getting the “true”/”false” values back when I do a Poll Now. But - as we know - LM won’t deal with strings natively. Workaround I came up with was to get length of the string since true/false are different lenghts. According to sources online, JSON Path should support a calculation of string length. I've also verified that I can do this by pasting my data and my JSON Path expression: $.[ComponentName].[ParameterName&ParameterType].length ...into https://jsonpath.com/ In this parser, the .length function works as expected, and returns the length of the JSON value. However, in LogicMonitor, I'm just getting this (example failure): NAN after processing with json (postProcessParam: $.[ComponentName].[ParameterName&ParameterType].length, reference=, useValue=body) Anyone know if there is a way to make this JSON Path length function work? SolvedBest way to deal with "dynamic" SNMP data I think this may be a bit of a unique scenario but I also think there might be a better way to deal with this than what I've tried so far. We're setting up LM to monitor a Crestron control system using their SNMP interface. Crestron supports some of the standard SNMP MIBs for reporting health of the control processors (e.g. Host Resources etc.) and then has a separate "IO" MIB that allows for reporting the status of various devices/systems that the control processors interface with. The main part of that MIB that I'm working with is essentially a table of status parameters (DataPoints in LM lingo), with each entry having some info about the parameter like the name of the parameter and the associated device, the current status, high/low value descriptions, etc. Couple simplified examples for purposes of this discussion: Table Entry 1 "Audio System" <-- Device name "Online Status" <--Parameter name 1 <-- current status "Online" <-- "1" description "Offline" <-- "0" description Table Entry 2 "Projector x"<-- Devicename "Power Status" <--Parameter name 0 <-- current status "On" <-- "1" description "Off" <-- "0" description My initial approach was just based on an SNMP DataSource with ActiveDiscovery. This works okay but then the DataPoint on every instance is just "Status" and I can't set different thresholds depending on the parameter name (afaik). Based on the above examples, I would want different thresholds for Online Status vs. Power Status. Specific question related to this: is there any way to set a DataPoint name and/or DataPoint thresholds based on data from Active Discovery (i.e. instance properties)? Any other ideas for the SNMP approach? The second option I'm trying is using a script-based DataSource where the script returns the proper DataPoint name/values (e.g. "Online Status=1"). In this scenario, I can make different DataPoints with different thresholds depending on the parameter. The issue I run into is that every instance will show all of the possible DataPoints for any instance whether they apply or not. This is slightly better than the previous scenario but we still end up with more noise/confusion than desired. Specific question related to this: is there any way to enable/disable or show/hide DataPoints on a per-instance level based on data from Active Discovery? Any other ideas on the script-based approach? If you've made it this far, thanks for taking the time! Re: Modify Alert trigger Interval on the Instance level In addition to the trigger interval, it would be good to have an option to modify alert thresholds on the instance level as well since not all instances are created equal. Nevermind, found it. Re: SNMP monitoring of non-Windows "Windows" devices Makes sense. Brainstorming some more, I did find that I can override the isWindows classification despite them telling me I can't. Turns out if you make your own isWindows AppliesTo function, that overrides the built-in one. I did a quick test with this logic and it seemed to do what I needed. See any issues with this (other than it not being officially supported)? (join(system.categories,",") =~ "Windows" || join(system.categories,",") =~ "Hyper-V" || system.sysinfo =~ "Windows" || system.sysinfo =~ "Hyper-V") && !hasCategory("Crestron") (we are applying the Crestron category as needed) Re: SNMP monitoring of non-Windows "Windows" devices On 7/20/2022 at 8:12 AM, Stuart Weenig said: This has the same disadvantage as modifying the core datasources. The main thing I don't like about tweaking AppliesTo logic on LM-provided Modules is that I could see a scenario where we update our Modules at some point in the future and LM has changed the AppliesTo logic on one or more of those Modules which overwrites our custom AppliesTo logic and now we've lost monitoring on some of our devices without knowing it. In the other scenario (cloned DataSources with our custom AppliesTo logic), the worst that would happen is we wouldn't get updates on those Modules but would continue to have the level of monitoring we did before. This make sense? Are my concerns on the first scenario warranted? Re: SNMP monitoring of non-Windows "Windows" devices Thanks for the detailed response @Stuart Weenig I kinda forgot about SysOID maps. I was able to remove Windows from system.categoriesby putting in a SysOID Map for the specific OID (1.3.6.1.4.1.311.1.1.3.3) which is apparently the OID for Windows CE. Since we don't have any other CE devices in our environment, I'm just telling LM it's not Windows. Unfortunately, the device still shows up with the isWindows() AppliesTo function and I think that's because of the "Windows" that shows up in system.sysinfo. I've reached out to the manufacturer to see if there is a way to tweak what gets presented there but my expectations are low. I feel like have some overrides that could be applied at a group level would be great. Something like a notWindows property... But it sounds like I'll have to do this the hard way. I really hate tweaking logic on core LM-provided LogicModules so I'm tempted to disable all the WMI LogicModules at the group level and then clone SNMP LogicModules with custom AppliesTo logic.
Top ContributionsXpath woesSolvedJSON Path capability in a Webpage DataSourceSolvedRe: Modify Alert trigger Interval on the Instance levelRe: Xpath woesRe: JSON Path capability in a Webpage DataSourceBest way to deal with "dynamic" SNMP dataSNMP monitoring of non-Windows "Windows" devicesRe: Remove/delete a category from many resourcesRemove/delete a category from many resourcesNetScans - Advanced naming of discovered devices??