Probably a stupid question

Pavleck, Jeremy Jeremy.Pavleck at capella.edu
Thu Apr 21 18:40:36 CEST 2005


 Ah thank you very much! This is very helpful, especially the
documentation link - as I didn't see anything like this with the built
in docs! I appreciate it!

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Marc
Powell
Sent: Thursday, April 21, 2005 11:30 AM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Probably a stupid question



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users- 
> admin at lists.sourceforge.net] On Behalf Of Pavleck, Jeremy
> Sent: Thursday, April 21, 2005 11:07 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Probably a stupid question
> 
> 
> Hi, just a quick question that I couldn't quite figure out from the
> documentation:
> 
> If I go to add a checkcommand, and specify arguments passed to it, do
I
> define what gets passed to that check command in the hosts file?
> Something like my_check arg1 arg2 arg3?
> 
> That seems like the most logical way to handle it, but I'm not certain

> if that's correct or not. Thanks.

The file doesn't matter. Arguments are defined in the check_command for
the service in question. Perhaps an example will help --

define command{
        command_name    check_ping
        command_line    $USER1$/check_ping $HOSTADDRESS$ -w
$ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p 10 -t 30
        }

define service {
        use                     generic-service
        host_name               my-host-name
        service_description     PING
        contact_groups          tnops
        check_command           check_ping!500!30%!1000!60%
        }

The values to be substituted are as follows --

$ARG1$ == 500
$ARG2$ == 30%
$ARG3$ == 1000
$ARG4$ == 60%

I could also make the values passed to -p and -t macros as well by using


define command{
        command_name    check_ping
        command_line    $USER1$/check_ping $HOSTADDRESS$ -w
$ARG1$,$ARG2$ -c $ARG3$,$ARG4$ -p $ARG5$ -t $ARG6$
        }

define service {
        use                     generic-service
        host_name               my-host-name
        service_description     PING
        contact_groups          tnops
        check_command           check_ping!500!30%!1000!60%!10!30
        }

Note that $ARGn$ macros are only available for service checks, not host
checks or anywhere else
(http://nagios.sourceforge.net/docs/1_0/macros.html).

Also, see the check_command explanation at
http://nagios.sourceforge.net/docs/1_0/xodtemplate.html#service.

HTH,

--
Marc


-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime
info, new features, or free trial, at:
http://www.businessobjects.com/devxi/728
_______________________________________________
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


-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
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