<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
jumping in a bit late on this one... <BR>
<BR>
so it sounds like the check itself works on the local box... so if you run from the nagios server <BR>
<BR>
./libexec/check_nrpe -H server -P 5666 -t 10 -c check_root<BR>
<BR>
and then... <BR>
./libexec/check_nrpe -H server -P 5666 -t 10 -c check_ora<BR>
<BR>
could your Nagios server also be connecting to the wrong server... ? I've had DNS issues drive me berserk before.<BR>
<BR><BR>-- <BR>Mat W. - <A href="http://www.techadre.com/">http://www.techadre.com</A><BR><BR><BR> <BR>
<HR id=stopSpelling>
<BR>
Date: Wed, 15 Jul 2009 16:14:27 +0300<BR>From: juki.emma@gmail.com<BR>To: guidosh@gmail.com<BR>CC: nagios-users@lists.sourceforge.net<BR>Subject: Re: [Nagios-users] Monitoring disk usage<BR><BR><FONT face=tahoma,sans-serif>Hi Guy,</FONT><BR><BR><FONT face=tahoma,sans-serif>My findings in-line...</FONT><BR><BR><BR><BR>
<DIV class=EC_gmail_quote>2009/7/15 Guy Waugh <SPAN dir=ltr><<A>guidosh@gmail.com</A>></SPAN><BR>
<BLOCKQUOTE class=EC_gmail_quote style="PADDING-LEFT: 1ex">
<DIV class=EC_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=EC_gmail_quote style="PADDING-LEFT: 1ex">
<DIV class=EC_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=EC_gmail_quote style="PADDING-LEFT: 1ex">
<DIV class=EC_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>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><br /><hr />Lauren found her dream laptop. <a href='http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290' target='_new'>Find the PC that’s right for you.</a></body>
</html>