Groovy Script Module - secondary hostProps
I am attempting to create a Topology module to address ongoing topology issues. Is there a way to target dataobjects (hosts) outside of the host that the module is targeting? Example: import org.json.JSONArray import com.santaba.agent.groovyapi.snmp.Snmp import com.santaba.agent.groovy.utils.GroovyScriptHelper as GSH import com.logicmonitor.mod.Snippets modLoader = GSH.getInstance(GroovySystem.version).getScript("Snippets", Snippets.getLoader()).withBinding(getBinding()) lmtopo = modLoader.load("lm.topo", "0") lmtopoSnmp = modLoader.load("lm.topo.snmp", "0") lmtopoData = modLoader.load("lm.data.topo", "1").create() //Normal working host props: def host = hostProps.get("system.hostname") //Secondary host??? -- made up method def referenceHost = getHost.byName("ServerName")107Views0likes0CommentsComplex datapoint - groovy script to calculate the value from the device property
Hi All, I have a case where I need to take AWS device property called ##system.aws.bandwidth## that can have values 1Gbps, 10Gbps or 50Gbps, convert it to bytes and return the value to the datapoint. I'm trying to use groovy script for complex datapoint but can't get it to work even with the most simple scripts: "Error Invalid enum value, must be EXPRESSION". Example script: if ('##system.aws.bandwidth##' == '1Gbps') { return 1000000000 } else if ('##system.aws.bandwidth##' == '10Gbps') { return 10000000000 } else if ('##system.aws.bandwidth##' == '50Gbps') { return 50000000000 } else { return 0 } Has anyone tried to create something similar? What I'm doing wrong? Thanks.159Views0likes8CommentsProcess Monitoring Batch Script
s there a way we can measure the performance of a Data Source or collectors? Repository: ProcessMonitoring @Stuart Weenig I presume I did not understand why monitoring lots of processes/services on Windows systems, with _Select Data Sources might not be the best approach. Aren’t both making a WMI call? Aren’t both going to bring all the Processes in one go? Can we see the query count from WMI Vs Batch Groovy?Solved192Views0likes7CommentsProcess Monitoring
Hi @Stuart Weenig Thank you for your awesome work! I was able to use the Win_Process_Stats_Groovy.xml file for creating data source for Process. https://github.com/sweenig/lm/tree/main/ProcessMonitoring I am able to see data in Discovery and Collector but under Raw Data in Devices > Data source I do not see any data , when I poll I do see data, am I missing something. My Applied To Wizard has the following query I removed the Win_Process_Stats.excludeRegEx & Win_Process_Stats.includeRegEx from “Applies To” isWindows() && system.displayname == "server001" or system.displayname == "server001"Solved371Views8likes10CommentsDoes anyone have any experience with monitoring Windows Processes?
I’ve checked the community for datasources and I don’t see anything to what I’m specifically looking for. Our organization currently utilizes the Microsoft_Windows_Services datasource (modified a little bit for our specific needs) to monitor services. I’m looking for something similar to monitor windows processes. Similar to the Microsoft_Windows_Services datasource, what I am hoping to accomplish is provide a list of keywords that will either match or be contained in the process name that I want to monitor, provide a list of machines that I want to monitor those processes on, and then get alerted on if those processes stop running. Some issues I am running into so far are: Win32_Process always returns a value of NULL for status and state. So I cannot monitor for those two class level properties. Powershell’s Get-Process does not return status or state, rather it just looks for processes that are actively running, so I would need to get creative in having LogicMonitor create the instance and what value to monitor in the instance. Some of the processes I want to monitor create multiple processes with the same name, and LogicMonitor then groups them all together into one instance, which makes monitoring diffucult. Some of the process I want to monitor are processes that only run if an application is manually launched, which means that again I will need to get creative in how I set up monitoring because I don’t want to get alerts when a process that I know shouldn’t be running is not running. Because the processes I am trying to monitor are not going to be common for everyone everywhere, something that other people could do to try to replicate my scenario would be: Open Chrome. When Chrome is launched, you will get a processed called “Chrome”. Now, open several other tabs of Chrome, you will just get more processes named “Chrome”. Now, keeping in mind the points I made earlier, set up monitoring to let you know when the 3rd tab in Chrome has been closed, even though the rest of the Chrome tabs are still open. How would you break that down? My first thought would be to monitor the PIDs, however, when you reboot your machine, your PIDs will likely change. Also, I don’t want to have the datasource wild value search by PID, because that would get confusing really fast once you have 2 or 3 different PIDs that you want to monitor. All suggestions are welcome, and any help is greatly appreciated. Bonus points if you can get this to work with the discovery method as Script and you use an embedded Groovy or Powershell script.Solved781Views12likes19Comments