Page 2 of 5

Re: Install nrpe on Ubuntu

Posted: Mon Aug 29, 2016 3:24 pm
by lmiltchev
H-m-m, I don't see anything wrong with the way your commands are defined in the "/etc/nagios/nrpe.cfg".

Did you restart NRPE after modifying the nrpe.cfg? Is there another config that nrpe could be using?

What is the output of the following commands?

Code: Select all

ps axuw | grep nrpe
netstat -at | grep nrpe
ls -l /bin/sh

Re: Install nrpe on Ubuntu

Posted: Mon Aug 29, 2016 3:50 pm
by Naveed
Yes I had restarted nrpe service after changing in nrpe.cfg file.

Code: Select all

root@HAWEB02:/usr/lib/nagios/plugins# ps axuw | grep nrpe
nagios   37002  0.0  0.0  23944  2480 ?        Ss   16:53   0:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root     47157  0.0  0.0   8216  2100 pts/1    R+   20:48   0:00 grep --color=auto nrpe
root@HAWEB02:/usr/lib/nagios/plugins# netstat -at | grep nrpe
tcp        0      0 *:nrpe                  *:*                     LISTEN
tcp6       0      0 [::]:nrpe               [::]:*                  LISTEN
root@HAWEB02:/usr/lib/nagios/plugins# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jun  4  2015 /bin/sh -> dash
root@HAWEB02:/usr/lib/nagios/plugins#

Re: Install nrpe on Ubuntu

Posted: Mon Aug 29, 2016 4:52 pm
by lmiltchev
Can you try running the following command on the client?

Code: Select all

sudo ln -sf bash /bin/sh
This should change the interpreter to "bash". Next, test running your checks from the command line. Let us know if this helped.

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 2:02 am
by Naveed
Command is executing fine on client side, but on nagios server side, it throws following error:

[root@AXmonitor vmn]# cd /usr/local/nagios/libexec/
[root@AXmonitor libexec]# ./check_nrpe -H 1.2.3.4 -p 5666 -c check_users
NRPE: Unable to read output

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 2:10 am
by Box293
On the client can you please do the following:

Code: Select all

su nagios
/usr/lib/nagios/plugins/check_users -w 5 -c 10
Please paste the output. I know you have shown us the results before however we need to see then executed as the nagios user, your previous tests were as the root user.

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 4:21 am
by Naveed
root@HADB02:/home/GIRU# su nagios
root@HADB02:/home/GIRU# id
uid=0(root) gid=0(root) groups=0(root)
root@HADB02:/home/GIRU# /usr/lib/nagios/plugins/check_users -w 5 -c 10
USERS OK - 1 users currently logged in |users=1;5;10;0
root@HADB02:/home/GIRU# /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
OK - load average: 0.00, 0.00, 0.00|load1=0.000;15.000;30.000;0; load5=0.000;10.000;25.000;0; load15=0.000;5.000;20.000;0;

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 6:12 am
by Naveed
I have re installation of nrpe with nagios xi official documentation, its not working either.

CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages

I have done all suggested solutions from internet.
dont_blame_nrpe=1
allowed_hosts=nagios server ip address
/etc/init.d/nrpe
allowed host = 127.0.0.1 nagios server ip
service xinted restart
/etc/init.d/nagios-nrpe-server restart

Kindly assist.

Thank you!

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 2:18 pm
by rkennedy
When executing the NRPE command, please show us what is populating in /var/log/messages on the client machine. This should provide a bit of debug.

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 3:15 pm
by Naveed
Aug 30 20:03:23 HAWEB02 nrpe[10104]: Client request was invalid, bailing out...
Aug 30 20:06:38 HAWEB02 systemd[1]: Started Session 16 of user GIRU.
Aug 30 20:07:03 HAWEB02 nrpe[10285]: Error: Request contained command arguments!
Aug 30 20:07:03 HAWEB02 nrpe[10285]: Client request was invalid, bailing out...
Aug 30 20:08:21 HAWEB02 nrpe[10312]: Error: Request contained command arguments!
Aug 30 20:08:21 HAWEB02 nrpe[10312]: Client request was invalid, bailing out...
Aug 30 20:11:59 HAWEB02 nrpe[10387]: Error: Request contained command arguments!
Aug 30 20:11:59 HAWEB02 nrpe[10387]: Client request was invalid, bailing out...
Aug 30 20:13:19 HAWEB02 nrpe[10433]: Error: Request contained command arguments!
Aug 30 20:13:19 HAWEB02 nrpe[10433]: Client request was invalid, bailing out...

Re: Install nrpe on Ubuntu

Posted: Tue Aug 30, 2016 3:34 pm
by lmiltchev
Errors like this one:
Aug 30 20:13:19 HAWEB02 nrpe[10433]: Error: Request contained command arguments!
Aug 30 20:13:19 HAWEB02 nrpe[10433]: Client request was invalid, bailing out...
indicate that either you haven't set up "dont_blame_nrpe=1" in the nrpe.cfg, or you haven't restarted NRPE daemon after changing this line. Is NRPE using more than one config?

What is the output of the following command?

Code: Select all

find / -name nrpe