How to get servicestate ok if the service is not running

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
robertcr
Posts: 3
Joined: Tue Aug 16, 2011 9:43 am

How to get servicestate ok if the service is not running

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

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

Post 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/
Master_Chief_Jon
Posts: 23
Joined: Fri Nov 19, 2010 1:31 pm

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

Post by Master_Chief_Jon »

Try using the Nagios check command 'negate' (http://nagiosplugins.org/man/negate).
Locked