Getting an Alert when a process IS running


#1

Hello,

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).

Any help will be greatly appreciated!

Kind regards,

Michael


#2

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.

you could also run:

to see all available options of a plugin


#3

Thanks!

I will not be able to test before next Monday, but will let you know if this works.

Will this work with a Windows server? Since the processes are running on a Windows server.

Thanks,

Michael


#4

No. I think that is only for checks on local server. For a Windows server checks I recommend NSClinet++


#5

I have nsclient+ running on all servers, so I can just go ahead and use the same options?

Cheers,

Michael


#6

I think you’ll have to use this on a remote Windows server:
trac.nakednuns.org/nscp/wiki/CheckProcState


#7

Actually I fixed it by using the Nagios negate command. With that you can negate all responses, so in this case Critical becomes Ok and visa versa.