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

Alexander Farber

alexander.farber at gmail.com
Fri Feb 13 13:11:09 UTC 2009


Hello CentOS users,

I have problems posting the question below
to the Nagios mailing list (my subscription is
not accepted for some reason). Has anybody
of you already had this probably frequent
problem with Nagios in CentOS? I can't use
check_squid from command-plugins.cfg (s. below)

Thank you for any hints
Alex


---------- Forwarded message ----------
To: nagios-users at lists.sourceforge.net


Dear Nagios users,

I'm using:

# cat /etc/*release
CentOS release 5.2 (Final) <-- compatible to RHEL 5.2

# rpm -qa|grep nagios
nagios-3.0.6-1.el5.rf
nagios-plugins-1.4.13-1.el5.rf

and have successfully added monitoring
of 20 other Linux-servers by replicating the
entries from /etc/nagios/objects/localhost.cfg

But now I'm trying to add 2 more things:

1) monitoring Squid
2) monitoring Apache at ports 8080 and 8090

I have found the following 3 lines:

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'

in the file /etc/nagios/command-plugins.cfg
and have added 1 more line:

command[check_http3]=/usr/lib/nagios/plugins/check_http -p $ARG1$ -I
$HOSTADDRESS$

(after reading "check_http --help").

In my config files I've added:

define host{
       use                     linux-server
       host_name               ablpdm01
       alias                   ablpdm01
       address                 10.121.42.100
       }
define service{
       use                             local-service
       host_name                       ablpdm01
       service_description             HTTP
       check_command                   check_http3!8090
       notifications_enabled           0
       }
..........
define host{
       use                     linux-server
       host_name               ablprx01
       alias                   ablprx01
       address                 10.121.42.32
       }
define service{
       use                             local-service
       host_name                       ablprx01
       service_description             Proxy
       check_command                   check_squid!8080
       }

Unfortunately I get errors now:

# nagios -v ../nagios.cfg

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
Error: Service check command 'check_http3' specified in service 'HTTP'
for host 'ablpdm01' not defined anywhere!
Error: Service check command 'check_http3' specified in service 'HTTP'
for host 'ablpdm02' not defined anywhere!
Error: Service check command 'check_http3' specified in service 'HTTP'
for host 'ablpdm03' not defined anywhere!
Error: Service check command 'check_squid' specified in service
'Proxy' for host 'ablprx01' not defined anywhere!
       Checked 123 services.
Checking hosts...
       Checked 16 hosts.
Checking host groups...
       Checked 5 host groups.
Checking service groups...
       Checked 0 service groups.
Checking contacts...
       Checked 1 contacts.
Checking contact groups...
       Checked 1 contact groups.
Checking service escalations...
       Checked 0 service escalations.
Checking service dependencies...
       Checked 0 service dependencies.
Checking host escalations...
       Checked 0 host escalations.
Checking host dependencies...
       Checked 0 host dependencies.
Checking commands...
       Checked 24 commands.
Checking time periods...
       Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   4

***> One or more problems was encountered while running the pre-flight check...

    Check your configuration file(s) to ensure that they contain valid
    directives and data defintions.  If you are upgrading from a previous
    version of Nagios, you should be aware that some variables/definitions
    may have been removed or modified in this version.  Make sure to read
    the HTML documentation regarding the config files, as well as the
    'Whats New' section to find out what has changed.

Does anybody have an idea what's wrong?

Isn't adding command[check_XXX]=YYY
to command-plugins.cfg enough?

I'm especially perplexed by check_squid being
not found even though it's there from the start

Thank you
Alex



More information about the CentOS mailing list