NSClient++ Help (#1) - check_nt - how to invert return value (#220) - Message List

check_nt - how to invert return value

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

gonza

  • Message #628

    IIRC you can do: process.exe=stopped or somesuch...

    MickeM

    • Message #629

      Sorry man, I confused processes with services.. This definition

      define service{

      use generic-service

      host_name server

      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

      gonza

      • Message #630

        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 Medin

Subscriptions