Forum Discussion
17 hours ago, breakerbreaker said:This is great! I could use a little more clarification on a couple of items, if you don't mind.
- 1. Can I return more than just a numerical value (0/1/2), like a string? A few examples of how it would look in Nagios might be "OK", "Warning: Site has not been backed up in 2 days", or "Critical: Site has not been backed up in 7 days". In other words, can I return a string that gives more clarification to "Warning" or "Critical"?
- 2. Can you provide me a resource that references all macros (Nagios calls them Macros, not sure what LM calls them) that I can use in the script? You provided me an example macro of ##SYSTEM.HOSTNAME##
You can return a string, but Datasources, only take numbers. If the script does return a string, you would have to convert it to a number using post-processing looking for the particular string. So it would turn it back into a number. You would then need to look into changing strategies over to an EventSource. The EventSource would output words (like a log file) and you'd write a check to look for particular words to open a specific kind of alarm.
LM calls them tokens. https://www.logicmonitor.com/support/logicmodules/datasources/creating-managing-datasources/tokens-available-for-data-collection/ You're only limited by your imagination because any device property value can be used as a token in the script. Properties can be set on the device level, or on a group level and inherited by each device in the group, or at a higher group level and inherited by all descendants.
Related Content
- 7 months ago
- 10 months ago