NSClient++ Help (#1) - check_nt - how to invert return value (#220) - Message List
Hi everyone, I am trying to figure out, if I use the check_nt plugin to see whether a certain process is running, can I also check whether a other process is _not_ running, so that Nagios will signal a critical state when the process starts to run? How would I do that? Thanx for any help, regards
IIRC you can do: process.exe=stopped or somesuch...
MickeMmickem08/13/08 10:14:52 (6 years ago)
Sorry man, I confused processes with services.. This definition
service_description Service description
check_command check_nt!SERVICESTATE! -l servicename=stopped
returns an OK state when the service is stopped (I am unable to try what will it return when the service will be started as this is a critical emergency service), but it also outputs a confusing message "OK: All services are running.". Is the syntax of the check alright with the "=stopped" parameter? Is there a way Nagios would output something like "OK: service stopped"? Thank you for your help, regards
gonzagonzales8208/13/08 11:25:19 (6 years ago)
my guess is yes, the "default message" is a default (regardless of what you have selected" you could do: servicex=started servicey=stopped etc etc and you will get a "OK: All services are running." (maybe a "all services in their apropriate state" would be better, but this is for compatibility I would guess. It is even possible that the messages (when you run over nsclient originates from the "check_nt" over which I have no control.
regardless a good way to try it is by temporarily replacing the service with one that is running (in the nagios conf) and you will see the result, or you can try it from the command line as well (see my guide).
Also note that there is a ShowAll option that will give you a more detailed response (ie. IIRC you will see each service and their state)
Michael Medinmickem08/13/08 11:50:06 (6 years ago)