[CentOS] Nagios: Error: Service check command ... not defined anywhere!

Fri Feb 13 13:45:05 UTC 2009
John Doe <jdmls at yahoo.com>

From: Alexander Farber <alexander.farber at gmail.com>
> > Still using 2.x here but, isn't there a commands.cfg file with some check_http 
> > definition?
> > In doubt, take a working check_xyz and grep it in all the conf files and see 
> > if you missed any...
> 
> thanks - yes, I always "grep -ri" for commands.
> 
> That is what perplexes me - the file
> 
>   # rpm -qf /etc/nagios/command-plugins.cfg
>   nagios-plugins-1.4.13-1.el5.rf
> 
> contains both check_http and (few lines below) check_squid:
> 
>   # grep check_http /etc/nagios/command-plugins.cfg
>   command[check_http]=/usr/lib/nagios/plugins/check_http -H
> $HOSTADDRESS$ -I $HOSTADDRESS$
>   command[check_http2]=/usr/lib/nagios/plugins/check_http -H $ARG1$ -I
>   $HOSTADDRESS$ -w $ARG2$ -c $ARG3$
>   command[check_squid]=/usr/lib/nagios/plugins/check_http -H
> $HOSTADDRESS$ -p $ARG1$  -u $ARG2$  -e 'HTTP/1.0 200 OK'
> 
> And still I can use check_http, but can't use check_squid:
> 
>   Error: Service check command 'check_squid' specified in service
>   'Proxy' for host 'ablprx01' not defined anywhere!

What I meant was that there should also be a definition in the commands.cfg file (if it is like 2.x)...

# grep check_http *
command-plugins.cfg:command[check_http]=/usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$
command-plugins.cfg:command[check_http2]=/usr/lib/nagios/plugins/check_http -H $ARG1$ -I $HOSTADDRESS$ -w $ARG2$ -c $ARG3$
command-plugins.cfg:# Using check_http will allow verification of authenticated proxies
command-plugins.cfg:command[check_squid]=/usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -p $ARG1$  -u $ARG2$  -e 'HTTP/1.0 200 OK'
commands.cfg:# 'check_http' command definition
commands.cfg:        command_name    check_http
commands.cfg:        command_line    $USER1$/check_http -H $HOSTADDRESS$
commands.cfg:                command_line    $USER1$/check_http -H $ARG1$ -u $ARG2$

JD