<font face="tahoma,sans-serif">Hi Guy,</font><br><br><font face="tahoma,sans-serif">My findings in-line...</font><br><br><br><div class="gmail_quote">2009/7/15 Guy Waugh <span dir="ltr"><<a href="mailto:guidosh@gmail.com">guidosh@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>They should only be defined in one place. From those errors, it sounds like NRPE on the monitored host doesn't have those commands defined, which suggests that it's not reading your nrpe.cfg config file. I would check out NRPE on the monitored host... do any checks on that host work at all? </div>
</div></blockquote><div><br><br><font face="tahoma,sans-serif">Yes, indeed the checks do work. These have been run on the monitored host. See below;<br><br><i style="color: rgb(255, 0, 0);">bash$ /usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /var/opt/BGw/Server1<br>
DISK OK - free space: /var/opt/BGw/Server1 35606 MB (68% inode=97%);| /var/opt/BGw/Server1=16589MB;37990;43417;0;54272<br><br>bash$ /usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /var/opt/BGw/Server1<br>DISK OK - free space: /var/opt/BGw/Server1 35614 MB (68% inode=97%);| /var/opt/BGw/Server1=16581MB;37990;43417;0;54272</i><br>
<br></font> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>Is the nrpe.cfg file in /usr/local/nagios/etc? Is either the NRPE daemon running or xinetd is handling the NRPE connections? Is the host listening on port 5666? Are the permissions on the nrpe.cfg file correct? What happens when you run an NRPE service check for that host manually, from the nagios server?</div>
</div></blockquote><div><br><font face="tahoma,sans-serif">Yes, the nrpe.cfg file is in /usr/local/nagios/etc with permissions;<br><br><i style="color: rgb(255, 0, 0);">bash$ ls -l /usr/local/nagios/etc/<br>total 32<br>-rw-r--r-- 1 nagios nagios 7871 Jul 15 14:21 nrpe.cfg</i><br>
<br>The NRPE daemon is running on the pid...<br><br><i style="color: rgb(255, 0, 0);">bash$ ps -ef | grep nrpe<br> root 25866 14582 0 16:01:25 pts/4 0:00 grep nrpe<br> nagios 1640 1 0 Jan 09 ? 49:38 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d<br>
nagios 9702 1 0 Jul 09 ? 1:27 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d</i><br><br>And listening on....<br><br><i style="color: rgb(255, 0, 0);">bash$ netstat -a | grep nrpe<br>emm4.nrpe *.* 0 0 49152 0 LISTEN<br>
*.nrpe *.* 0 0 49152 0 LISTEN<br>localhost.nrpe *.* 0 0 49152 0 LISTEN</i><br><br>On running a telnet (on port 5666) to the monitored host from the nagios monitoring server, I get;<br>
<br><i style="color: rgb(255, 0, 0);">relay$ telnet 10.0.0.5 5666<br>Trying 10.0.0.5...<br>Connected to 10.0.0.5.<br>Escape character is '^]'.</i><br><br>When I run an NRPE service check for the monitored host manually from the nagios server, I get;<br>
<br><i style="color: rgb(255, 0, 0);">relay$ /usr/local/nagios/libexec/check_nrpe -H 10.0.0.5 -p 5666 -c check_disk /var/opt/mediation/ora<br>DISK OK - free space: / 22848 MB (37% inode=23%);| /=37500MB;54862;57910;0;60958 1491</i><br>
<br>This shows that the check_nrpe command is retrieving the details for the root (/) partition and NOT those of the </font><font face="tahoma,sans-serif">/var/opt/mediation/ora partition</font><br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div>
<br>If none of that give you any joy, post the nrpe.cfg file to this list if you like, suitably obfuscated of course.<br></div></div></blockquote><div><br><br><br><font face="tahoma,sans-serif">A copy of the nrpe.cfg file as follows;<br>
<br><br><i style="color: rgb(255, 0, 0);">bash$ more nrpe.cfg<br>#############################################################################<br># Sample NRPE Config File<br># Written by: Ethan Galstad (<a href="mailto:nagios@nagios.org">nagios@nagios.org</a>)<br>
#<br># Last Modified: 11-23-2007<br>#<br># NOTES:<br># This is a sample configuration file for the NRPE daemon. It needs to be<br># located on the remote host that is running the NRPE daemon, not the host<br># from which the check_nrpe client is being executed.<br>
#############################################################################<br><br><br># LOG FACILITY<br># The syslog facility that should be used for logging purposes.<br><br>log_facility=daemon<br><br><br># PID FILE<br>
# The name of the file in which the NRPE daemon should write it's process ID<br># number. The file is only written if the NRPE daemon is started by the root<br># user and is running in standalone mode.<br><br>pid_file=/var/run/nrpe.pid<br>
<br><br># PORT NUMBER<br># Port number we should wait for connections on.<br># NOTE: This must be a non-priviledged port (i.e. > 1024).<br># NOTE: This option is ignored if NRPE is running under either inetd or xinetd<br>
<br>server_port=5666<br><br><br><br># SERVER ADDRESS<br># Address that nrpe should bind to in case there are more than one interface<br># and you do not want nrpe to bind on all interfaces.<br># NOTE: This option is ignored if NRPE is running under either inetd or xinetd<br>
<br>#server_address=127.0.0.1<br><br># NRPE USER<br># This determines the effective user that the NRPE daemon should run as.<br># You can either supply a username or a UID.<br>#<br># NOTE: This option is ignored if NRPE is running under either inetd or xinetd<br>
#server_address=127.0.0.1<br><br><br># NRPE USER<br># This determines the effective user that the NRPE daemon should run as.<br># You can either supply a username or a UID.<br>#<br># NOTE: This option is ignored if NRPE is running under either inetd or xinetd<br>
<br>nrpe_user=nagios<br><br># NRPE GROUP<br># This determines the effective group that the NRPE daemon should run as.<br># You can either supply a group name or a GID.<br>#<br># NOTE: This option is ignored if NRPE is running under either inetd or xinetd<br>
<br>nrpe_group=nagios<br><br># ALLOWED HOST ADDRESSES<br># This is an optional comma-delimited list of IP address or hostnames<br># that are allowed to talk to the NRPE daemon.<br>#<br># Note: The daemon only does rudimentary checking of the client's IP<br>
# address. I would highly recommend adding entries in your /etc/hosts.allow<br># file to allow only the specified host to connect to the port<br># you are running this daemon on.<br>#<br># NOTE: This option is ignored if NRPE is running under either inetd or xinetd<br>
<br>allowed_hosts=10.0.0.5<br><br># COMMAND ARGUMENT PROCESSING<br># This option determines whether or not the NRPE daemon will allow clients<br># to specify arguments to commands that are executed. This option only works<br>
# if the daemon was configured with the --enable-command-args configure script<br># option.<br>#<br># *** ENABLING THIS OPTION IS A SECURITY RISK! ***<br># Read the SECURITY file for information on some of the security implications<br>
# of enabling this variable.<br>#<br># Values: 0=do not allow arguments, 1=allow command arguments<br><br>dont_blame_nrpe=0<br><br># COMMAND PREFIX<br># This option allows you to prefix all commands with a user-defined string.<br>
# A space is automatically added between the specified prefix string and the<br># command line from the command definition.<br>#<br># *** THIS EXAMPLE MAY POSE A POTENTIAL SECURITY RISK, SO USE WITH CAUTION! ***<br># Usage scenario:<br>
# Execute restricted commmands using sudo. For this to work, you need to add<br># the nagios user to your /etc/sudoers. An example entry for alllowing<br># execution of the plugins from might be:<br>#<br># nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/<br>
#<br># This lets the nagios user run all commands in that directory (and only them)<br># without asking for a password. If you do this, make sure you don't give<br># random users write access to that directory or its contents!<br>
<br># command_prefix=/usr/bin/sudo<br><br># DEBUGGING OPTION<br># This option determines whether or not debugging messages are logged to the<br># syslog facility.<br># Values: 0=debugging off, 1=debugging on<br><br>debug=0<br>
<br><br># COMMAND TIMEOUT<br># This specifies the maximum number of seconds that the NRPE daemon will<br># allow plugins to finish executing before killing them off.<br><br>command_timeout=60<br><br># CONNECTION TIMEOUT<br>
# This specifies the maximum number of seconds that the NRPE daemon will<br># wait for a connection to be established before exiting. This is sometimes<br># seen where a network problem stops the SSL being established even though<br>
# all network sessions are connected. This causes the nrpe daemons to<br># accumulate, eating system resources. Do not set this too low.<br><br>connection_timeout=300<br><br># WEEK RANDOM SEED OPTION<br># This directive allows you to use SSL even if your system does not have<br>
# a /dev/random or /dev/urandom (on purpose or because the necessary patches<br># were not applied). The random number generator will be seeded from a file<br># which is either a file pointed to by the environment valiable $RANDFILE<br>
# or $HOME/.rnd. If neither exists, the pseudo random number generator will<br># be initialized and a warning will be issued.<br># Values: 0=only seed from /dev/[u]random, 1=also seed from weak randomness<br><br>#allow_weak_random_seed=1<br>
# INCLUDE CONFIG FILE<br># This directive allows you to include definitions from an external config file.<br><br>#include=<somefile.cfg><br><br># INCLUDE CONFIG DIRECTORY<br># This directive allows you to include definitions from config files (with a<br>
# .cfg extension) in one or more directories (with recursion).<br><br>#include_dir=<somedirectory><br>#include_dir=<someotherdirectory><br><br># COMMAND DEFINITIONS<br># Command definitions that this daemon will run. Definitions<br>
# are in the following format:<br>#<br># command[<command_name>]=<command_line><br>#<br># When the daemon receives a request to return the results of <command_name><br># it will execute the command specified by the <command_line> argument.<br>
#<br># Unlike Nagios, the command line cannot contain macros - it must be<br># typed exactly as it should be executed.<br>#<br># Note: Any plugins that are used in the command lines must reside<br># on the machine that this daemon is running on! The examples below<br>
# assume that you have plugins installed in a /usr/local/nagios/libexec<br># directory. Also note that you will have to modify the definitions below<br># to match the argument format the plugins expect. Remember, these are<br>
# examples only!<br><br># The following examples use hardcoded command arguments...<br><br>command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10<br>command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20<br>
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1<br>command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z<br>command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200<br>
<br>#emm4 specific commands#<br>command[check_root]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /<br>command[check_var]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /var<br>command[check_server1]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /var/opt/BGw/Server1<br>
command[check_ora]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /var/opt/mediation/ora<br>command[check_swap]= /usr/local/nagios/libexec/check_swap -a -w 10% -c 5%<br>command[check_procs]=/usr/local/nagios/libexec/check_procs -w 300 -c 400<br>
command[check_ssh]=/usr/local/nagios/libexec/check_ssh -4 -t 10 -p 22 localhost<br>command[check_ftp]=/usr/local/nagios/libexec/check_ftp -t 5<br><br># The following examples allow user-supplied arguments and can<br># only be used if the NRPE daemon was compiled with support for<br>
# command arguments *AND* the dont_blame_nrpe directive in this<br># config file is set to '1'. This poses a potential security risk, so<br># make sure you read the SECURITY file before doing this.<br><br>#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$<br>
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$<br>#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$<br>#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$</i><br>
<br><br>It still puzzles me....<br><br>Regards,<br>Juki<br><br><br><br></font> <br></div></div>