FAQ
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

Search Discussions

  • Rainer Duffner at Feb 13, 2009 at 1:17 pm

    Alexander Farber schrieb:
    Hello CentOS users,

    I have problems posting the question below
    to the Nagios mailing list (my subscription is
    not accepted for some reason).

    You should complain to the administrators of that mailing-list.



    Rainer
  • Alexander Farber at Feb 13, 2009 at 1:22 pm
    I still think my question isn't offtopic here -
    seeing how people discuss procmail/logrotate/etc.
    On Fri, Feb 13, 2009 at 2:17 PM, Rainer Duffner wrote:
    Alexander Farber schrieb:
    I have problems posting the question below
    to the Nagios mailing list (my subscription is
    not accepted for some reason).
    You should complain to the administrators of that mailing-list.
  • John Doe at Feb 13, 2009 at 4:23 pm
    From: Alexander Farber <alexander.farber at gmail.com>
    I have problems posting the question below
    to the Nagios mailing list (my subscription is
    not accepted for some reason).
    You should complain to the administrators of that mailing-list.
    I still think my question isn't offtopic here -
    seeing how people discuss procmail/logrotate/etc.
    I think he was just referring to your nagios mailing list problems...

    JD
  • John Doe at Feb 13, 2009 at 1:31 pm

    Alexander Farber schrieb:
    I have problems posting the question below
    to the Nagios mailing list (my subscription is
    not accepted for some reason).
    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...

    JD
  • Alexander Farber at Feb 13, 2009 at 1:40 pm
    Hello,
    On Fri, Feb 13, 2009 at 2:31 PM, John Doe wrote:
    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!

    Regards
    Alex
  • John Doe at Feb 13, 2009 at 1:45 pm
    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
  • Alexander Farber at Feb 13, 2009 at 2:03 pm

    On Fri, Feb 13, 2009 at 2:45 PM, John Doe wrote:
    What I meant was that there should also be a definition in the commands.cfg file (if it is like 2.x)...
    Allright - that was it:

    I should have added the commands
    to the /etc/nagios/objects/commands.cfg
    and not to the /etc/nagios/command-plugins.cfg

    Thanks
    Alex
  • Rainer Duffner at Feb 13, 2009 at 2:06 pm

    Alexander Farber schrieb:
    On Fri, Feb 13, 2009 at 2:45 PM, John Doe wrote:

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

    I should have added the commands
    to the /etc/nagios/objects/commands.cfg
    and not to the /etc/nagios/command-plugins.cfg

    Well, you can include those, too (I think in nagios.cfg).

    I had (like you) assumed, you already included that file.
    Always check if the file you use is actually included in the
    main-configuration...



    Rainer
  • Alexander Farber at Feb 13, 2009 at 2:12 pm
    Hello,
    On Fri, Feb 13, 2009 at 3:06 PM, Rainer Duffner wrote:
    Alexander Farber schrieb:
    I should have added the commands
    to the /etc/nagios/objects/commands.cfg
    and not to the /etc/nagios/command-plugins.cfg
    Well, you can include those, too (I think in nagios.cfg).

    I had (like you) assumed, you already included that file.
    Always check if the file you use is actually included in the
    main-configuration...
    unfortunately you can't put
    cfg_file=/etc/nagios/objects/commands.cfg
    into /etc/nagios/nagios.cfg -
    it will bail out with an error message.

    IMHO it's a bug in nagios-plugins-1.4.13-1.el5.rf

    Greetings from Bochum
    Alex
  • Alexander Farber at Feb 13, 2009 at 2:37 pm
    Oops a typo - I actually mean:

    unfortunately you can't put
    cfg_file=/etc/nagios/command-plugins.cfg
    into /etc/nagios/nagios.cfg -
    it will bail out with an error message.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedFeb 13, '09 at 1:11p
activeFeb 13, '09 at 4:23p
posts11
users3
websitecentos.org
irc#centos

People

Translate

site design / logo © 2022 Grokbase