Page 1 of 1

Nrpe issues

Posted: Mon Jul 30, 2012 1:34 pm
by noodle48
I have Nagios Core running on RHEL 6.3 and Nrpe pulgin running on AIX 5.3. I get the Nagios server to return check_nrpe -H hostip -n back but AIX server gets Error receiving data from daemon. I also issue a command for nrpe to check run from Nagios server:

check_nrpe -H hostIP -n -c command - get check proc count must be integer.

But run a check_nrpe -H nagiosIP -n get this in /var/log/messages:

xinetd[29756]: START: nrpe pid=30023 from=AIX IP
xinetd[30023]: libwrap refused connection to nrpe (libwrap=nrpe) from AIX IP
xinetd[30023]: FAIL: nrpe libwrap from=AIX IP
xinetd[29756]: EXIT: nrpe status=0 pid=30023 duration=0(sec)

Please help!

Re: Nrpe issues

Posted: Mon Jul 30, 2012 2:05 pm
by slansing
Can you check your:

Code: Select all

/etc/hosts.allow
And make sure that your server is defined there?

Example:

Code: Select all

nrpe:192.0.0.0

Re: Nrpe issues

Posted: Mon Jul 30, 2012 2:45 pm
by noodle48
Once I added the nrpe: AIX IP and restart xientd I was able to get them talking with NRPE v2.13 on both servers. But when I issue the remote command to run I still get:

Nagios Server:
./check_nrpe -H AIX Host -n -c check_command
check_procs: Warning Process Count must be an integer!
Usage:
check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-t timeout] [-v]

AIX Nrpe.cfg file:

# The following examples use hardcoded command arguments...

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_command]=/usr/local/nagios/libexec/check_procs -w 2 -c 2 -a 'command'


# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'. This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.

#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
command[check_command]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -a $ARG3$

Re: Nrpe issues

Posted: Mon Jul 30, 2012 3:01 pm
by slansing
Could you please post what you are plugging in for the arguments:

Code: Select all

-w $ARG1$ -c $ARG2$ -s $ARG3$

Re: Nrpe issues

Posted: Mon Jul 30, 2012 3:04 pm
by noodle48
I'm guessing your wanting on the AIX server:

command[check_command]=/usr/local/nagios/libexec/check_procs -w 2 -c 2 -a 'process running'

Re: Nrpe issues

Posted: Mon Jul 30, 2012 3:12 pm
by slansing
Yes the command is to be run from the Nagios server directed at your AIX server, have you checked the guidelines found here?

http://nagiosplugins.org/man/check_procs

Re: Nrpe issues

Posted: Tue Jul 31, 2012 11:57 am
by noodle48
Yes, as my last post states the command I want the AIX server to run. But again I issue the command from Nagios server I get Waring Process Count must be an integer! but on AIX I get the correct output.

Re: Nrpe issues

Posted: Wed Aug 01, 2012 8:28 am
by noodle48
More information:

I issued the check_nrpe scripted from my Nagios server with the default nrpe script (standard on install) check_procs. and it returned correctly. When I issue the check_nrpe on a custom command I placed in I get the error:
Warning Process Count must be an integer!

Below is my command I want the Nagios server to issue:
command[check_data]=/usr/local/nagios/libexec/check_procs -w 2 -c 2 -a 'Argument'

Nagios server issuing nrpe check:
./check_nrpe -H AIX Server -c check_data
check_procs: Warning Process Count must be an integer!
Usage:
check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-t timeout] [-v]

Re: Nrpe issues

Posted: Wed Aug 01, 2012 8:38 am
by noodle48
I got it solved, thanks for the help!

Re: Nrpe issues

Posted: Wed Aug 01, 2012 9:18 am
by slansing
Excellent! Glad you found a solution.