Exploding check commands batman ...

Andrew_Hoying at blm.gov Andrew_Hoying at blm.gov
Fri Jul 1 08:01:21 CEST 2005





I think in your situation you'd be better off doing something like this:

define command{
  command_name    check_http
  command_line    $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
  }

Then your ARG1 can contain flags and parameters specific to the needs of
that one check. Like check_http_str!localhost!-u '/' -s 'Nagios' or
whatever. That's how I do it.

Andrew



                                                                           
             Gavin Carr                                                    
             <gavin at openfusion                                             
             .com.au>                                                   To 
             Sent by:                  Nagios Users                        
             nagios-users-admi         <nagios-users at lists.sourceforge.net 
             n at lists.sourcefor         >                                   
             ge.net                                                     cc 
                                                                           
                                                                   Subject 
             06/30/2005 11:52          [Nagios-users] Exploding check      
             PM                        commands batman ...                 
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi all,

I'm just wanting to sanity check whether I'm missing something in
how check_commands and services work together. To do various kinds
of http checks, for instance, I've currently got the following
defined in check_commands.cfg (Nagios 1.2, btw):

define command{
  command_name    check_http
  command_line    $USER1$/check_http -H $HOSTADDRESS$
  }
define command{
  command_name    check_http_auth
  command_line    $USER1$/check_http -H $HOSTADDRESS$ -a '$ARG1$'
  }
define command{
  command_name    check_http_str
  command_line    $USER1$/check_http -H $HOSTADDRESS$ -s '$ARG1$'
  }
define command{
  command_name    check_http_re
  command_line    $USER1$/check_http -H $HOSTADDRESS$ -l -R '$ARG1$'
  }
define command{
  command_name    check_http_uri_str
  command_line    $USER1$/check_http -H $HOSTADDRESS$ -u '$ARG1$' -s
'$ARG2$'
  }
define command{
  command_name    check_http_uri_re
  command_line    $USER1$/check_http -H $HOSTADDRESS$ -u '$ARG1$' -l -R
'$ARG2$'
  }

I've got another set where I want to specify the host using
'-H $ARG1$', and then all of those are duplicated with '-S' for
https tests, etc., so I've got 24 or so http test so far. Now I
want to monitor another set of sites on a non-standard port, so
I need an additional '-p' argument!

Is this the way other people are doing it, or am I missing
something obvious? Is this handled any differently in version
2.0?

Cheers,
Gavin



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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