LinuxNewProcesses DataSource -- Auto discovery and key off of HOST-RESOURCES-MIB::hrSWRunName
Hello all!
I just wanted to share my edits. I never could get LinuxNewProcesses to work for my needs.. but we really wanted it to also have auto discovery and automatically add a list of toolsets that we have deployed across the board.
I did this LONG ago and my wildvalue was the PID… but that’s dangerous and I ended up creating thousands of entries in the LM database because my processes (thousands of them) were always changing. . . .this takes a different approach and keys off of the process name.
#1 You just need to have a property defined with a comma separated list
These names need to be from “HOST-RESOURCES-MIB::hrSWRunName”
#2 My polling is every minute but don’t alert unless it’s been down for an hour… for my scenario, I do this on purpose because some of my applications run for about 5 minutes and then aren’t kicked off again for another 10… so adjust as needed :)
The status is under a security review right now.. I’ll post the lmLocator if it makes it!
Otherwise here’s the autodiscovery.. the collection script wont’ work and you’ll have to modify it
import com.santaba.agent.groovyapi.snmp.Snmp;
def OID_NAME = ".1.3.6.1.2.1.25.4.2.1.2";
def host = hostProps.get("system.hostname");
def services = hostProps.get("linux.services").split(',');
Map<String, String> result = Snmp.walkAsMap(host, OID_NAME, null)
result.forEach({
index,value->index = index; value = value;
for (service in services) {
if (value ==~ /${service}/) {
def CMD_OID = ".1.3.6.1.2.1.25.4.2.1.4." + index;
def service_cmd = Snmp.get(host, CMD_OID);
def desc = index + " | " + service_cmd;
out.println value + "##" + value + "##" + desc
}
}
})
Script: Line 89:
if ("${name}" == "${processPath}") {