How can I be notified in case a certain process IS running or a certain service is in started mode?
By default I get alerts when the process/service is NOT running, but I want to have it the other way around, since if the process is (still) running there is an error (in this case a hanging backup batch job).
Try to use this (run from the terminal and implement in nagios if you like it):
(of course you have to be in a directory containing check_procs executable)
0:0 critical threshold will issue critical alert only if output is out of specified range, and since we’ve set this range from 0 to 0, if no process is running it will return an OK state. If there is 1 or more processes running, it will issue critical state.
-a switch defines the strinh which to serach within processes.