NRPE with user-supplied args: NRPE doesn't seem to get args

Guy Waugh gwaugh at scu.edu.au
Thu May 5 06:44:28 CEST 2005


Hi there,

I've been using nagios 1.2 on a RHEL3 box for a month or so, just 
monitoring the nagios host. All is well.

I'm now trying to monitor a remote host using nrpe. The remote host is 
also a RHEL3 box. It doesn't have nagios installed - just the plugins, 
and the nrpe daemon, which I have set up to run under xinetd.

I'm having trouble setting up the first service to check on the remote 
host. I'm trying to set up check_users.

Here's the relevant bit of checkcommands.cfg for check_nrpe (on the 
nagios host):

# 'check_nrpe' command definition
define command{
         command_name    check_nrpe
         command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
         }

----------------------------------------------------------------------

Here's the service definition in services.cfg (on the nagios host) for 
check_users on the remote server:

 
 

define service{
         use                             generic-service         ; Name 
of service template to use
         host_name                       remote-server
         service_description             Current Users
         is_volatile                     0
         check_period                    24x7
         max_check_attempts              3
         normal_check_interval           5
         retry_check_interval            2
         contact_groups                  linux-admins
         notification_interval           240
         notification_period             24x7
         notification_options            w,u,c,r
         check_command                   check_nrpe!check_users!5!10
         }

----------------------------------------------------------------------

Here's the command definition for check_users in nrpe.cfg on the remote 
host:

command[check_users]=/usr/local/inst/nagios-1.2/libexec/check_users -w 
$ARG1$ -c $ARG2$

(I have compiled nrpe with --enable-command-args.)

----------------------------------------------------------------------

If I try the command manually from the nagios host, it works:

sh-2.05b$ whoami
nagios
sh-2.05b$ ./check_nrpe -H remote-server -c check_users -a 5 10
USERS OK - 3 users currently logged in |users=3;5;10;0
sh-2.05b$

However, nagios doesn't like it - the status of the check_users service 
on remote-server is 'UNKNOWN', and Status Information says: 
'check_users: Warning threshold must be a positive integer'.

It seems as if nrpe on the remote-server doesn't receive the warning and 
critical arguments.

Can anyone suggest what I'm doing wrong? Is my definition of the 
check_nrpe command (in checkcommands.cfg) on the nagios host correct?

Thanks,
Guy.



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list