On Tue, Nov 10, 2009 at 4:04 PM, Marc Powell <[email protected]> wrote: > > 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 > <[email protected]> > > 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
[r...@omajelut01 plugins]# /usr/lib64/nagios/plugins/negate -c WARNING /usr/lib64//nagios/plugins/check_nrpe -H host -t 50 -c checkServiceState -a ShowAll MSSQLSERVER=started CRITICAL: MSSQLSERVER: stopped (critical) [r...@omajelut01 plugins]# echo $? 1 The plugin still says CRITICAL but as you can see will actually register as a warning. Perfect. Thanks! ------------------------------------------------------------------------------ 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 [email protected] 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
