nsclient changing service down state

Marc Powell marc at ena.com
Tue Nov 10 23:04:10 CET 2009


On Nov 10, 2009, at 3:44 PM, Terry wrote:

> Hello,
>
> I have a simple check set up to check a windows service using
> nsclient++.  It works great.  However, I want it to go to a warning
> state when a service is stopped, not critical:
> -sh-3.2$ /usr/lib64/nagios/plugins/check_nrpe -H host -t 50 -c
> checkServiceState -a ShowAll MSSQLSERVER=started
> CRITICAL: MSSQLSERVER: stopped (critical)
> -sh-3.2$ echo $?
> 2
>
> Again, I don't want it to ALWAYS be warning, just not be critical.

If you always want CRITICAL to be changed to WARNING for this test,  
you could use the negate plugin.

  ./negate --help
negate v1859 (nagios-plugins 1.4.11)
Copyright (c) 2002-2007 Nagios Plugin Development Team
	<nagiosplug-devel at lists.sourceforge.net>

Negates the status of a plugin (returns OK for CRITICAL and vice-versa).
Additional switches can be used to control which state becomes what.


Usage:negate [-t timeout] [-owcu STATE] <definition of wrapped plugin>
         [snippage]
  -c,--critical=STATUS

     STATUS can be 'OK', 'WARNING', 'CRITICAL' or 'UNKNOWN' without  
single
     quotes. Numeric values are accepted. If nothing is specified,  
permutes
     OK and CRITICAL.

--
Marc


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list