Arbitrary command monitor

Is there any sort of arbitary command monitor where I could define a poller or collection that runs a command either directly on the opennms server, where I could pass in parameters from opennms, and then have data returned and then processed as per normal polling or data collection?

for example, I’d like to be able to monitor the running kernel vs installed kernel on my monitored nodes and raise an event if the running kernel is ever different to the installed kernel. this would allow me to detect when someone has patched a server but forgotten to reboot.

I’ve written a script that uses snmp to query .1.3.6.1.2.1.25.6.3.1.2 to get the version of the most recently installed kernel, and .1.3.6.1.2.1.1.1.0 to get the kernel version of the running kernel and does some manipulation to extract the exact kernel version for comparison, but it would be good if this could be driven from opennms where OpenNMS calls the script for each node passing in relevant parameters like IP address, snmp community/proxy, etc… and then the script returns an appropriate response for opennms to process.

Regards,
John

The SystemExecuteMonitor runs arbitrary system commands forking a process out of the JVM on your OpenNMS server. The result is evaluated against the commands exit code 0 for UP and non-0 for DOWN or a banner match. Hope this helps.

1 Like

That sounds like it is what I’m after in this instance. I will have a look in the morning.

Thanks,
John

I found there is a page in the wiki for this with an example https://wiki.opennms.org/wiki/SystemExecuteMonitor

however, it seems to have a formatting error on the page.

But this looks exactly what I’m after :smiley:
Thanks again,
John