Page 1 of 1

How to get servicestate ok if the service is not running

Posted: Tue Aug 16, 2011 9:51 am
by robertcr
Hi people

I need to check a service, but I need get a OK state if the service is stopped.

For instance, I have the service "DPS" running on two servers, but one is started and the other one is stopped.

I need to get the service stopped as OK state

Anyone know how can I get this?

I´m using this command:

check_nt -H $HOSTADDRESS$ -p $PORT -v -d SHOWALL -l "DPS"


thanks

Re: How to get servicestate ok if the service is not running

Posted: Tue Aug 16, 2011 1:46 pm
by mguthrie
Your best resource for that question might be in NSClient's documentation, I don't know specifically how to do what you're asking but I'm betting you're not the first person who has needed to.
http://nsclient.org/nscp/

Re: How to get servicestate ok if the service is not running

Posted: Thu Aug 18, 2011 8:40 am
by Master_Chief_Jon
Try using the Nagios check command 'negate' (http://nagiosplugins.org/man/negate).