check_http -a Question

Marc Powell marc at ena.com
Thu Mar 9 23:11:03 CET 2006



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Jonathan Gourd
> Sent: Thursday, March 09, 2006 3:59 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] check_http -a Question
> 
> I am defining a service and I am getting stuck. When I define the
check
> command as 'check_http -a foo:bar' I get the following output when
> starting:
> 
> 
> ---------BEGIN QUITE-----------
> Checking services...
> Error: Service check command 'check_http -a foo:bar' specified in
service
> 'HTTP' for host 'syndb-b' not defined anywhere!
> ---------END QUOTE------------
> 

The check_command for a host or service definition is a reference to a
command{} definitions command_name, not the direct command line that is
run. You either need to hard-code your '-a foo:bar' to the actual
command{} definition itself like 

define command{
        command_name    check_http
        command_line    $USER1$/check_http $HOSTADDRESS$ -t 45 -a
foo:bar
        }

Or pass it as an argument from your service{} definition to a properly
configured command{} definition like

define command{
        command_name    check_http
        command_line    $USER1$/check_http $HOSTADDRESS$ -t 45 -a $ARG1$
        }

define service{
        use                             generic-service
        host_name                       somehost
        service_description             MY_HTTP_CHECK
        retry_check_interval            3
        contact_groups                  whoever
        check_command                   check_http!foo:bar
        }

In the above example, 'foo:bar' becomes $ARG1$ and is substituted into
the command_line for the command_name check_http.

--
Marc 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
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