Install nrpe on Ubuntu

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Install nrpe on Ubuntu

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post 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#
Last edited by tmcdonald on Mon Aug 29, 2016 4:43 pm, edited 3 times in total.
Reason: Please use [code][/code] tags around terminal output
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Install nrpe on Ubuntu

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Install nrpe on Ubuntu

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post 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;
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post 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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Install nrpe on Ubuntu

Post 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.
Former Nagios Employee
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post 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...
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Install nrpe on Ubuntu

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked