Install nrpe on Ubuntu

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post by Naveed »

root@HAWEB02:/home/GIRU# find / -name nrpe
root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU# cat /etc/nagios/nrpe.cfg |grep dont
dont_blame_nrpe=1
root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU# /etc/init.d/nagios-nrpe-server restart
[ ok ] Restarting nagios-nrpe-server (via systemctl): nagios-nrpe-server.service.
root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU# tail -100 /var/log/syslog
Aug 30 20:03:23 HAWEB02 nrpe[10104]: Error: Request contained command arguments!
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...
Aug 30 20:16:57 HAWEB02 nrpe[10497]: Error: Request contained command arguments!
Aug 30 20:16:57 HAWEB02 nrpe[10497]: Client request was invalid, bailing out...
Aug 30 20:17:01 HAWEB02 CRON[10500]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Aug 30 20:18:17 HAWEB02 nrpe[10525]: Error: Request contained command arguments!
Aug 30 20:18:17 HAWEB02 nrpe[10525]: Client request was invalid, bailing out...
Aug 30 20:21:56 HAWEB02 nrpe[10570]: Error: Request contained command arguments!
Aug 30 20:21:56 HAWEB02 nrpe[10570]: Client request was invalid, bailing out...
Aug 30 20:23:15 HAWEB02 nrpe[10606]: Error: Request contained command arguments!
Aug 30 20:23:15 HAWEB02 nrpe[10606]: Client request was invalid, bailing out...
Aug 30 20:26:55 HAWEB02 nrpe[10698]: Error: Request contained command arguments!
Aug 30 20:26:55 HAWEB02 nrpe[10698]: Client request was invalid, bailing out...
Aug 30 20:28:13 HAWEB02 nrpe[10742]: Error: Request contained command arguments!
Aug 30 20:28:13 HAWEB02 nrpe[10742]: Client request was invalid, bailing out...
Aug 30 20:31:54 HAWEB02 nrpe[10795]: Error: Request contained command arguments!
Aug 30 20:31:54 HAWEB02 nrpe[10795]: Client request was invalid, bailing out...
Aug 30 20:33:12 HAWEB02 nrpe[10816]: Error: Request contained command arguments!
Aug 30 20:33:12 HAWEB02 nrpe[10816]: Client request was invalid, bailing out...
Aug 30 20:36:52 HAWEB02 nrpe[10864]: Error: Request contained command arguments!
Aug 30 20:36:52 HAWEB02 nrpe[10864]: Client request was invalid, bailing out...
Aug 30 20:38:10 HAWEB02 nrpe[10892]: Error: Request contained command arguments!
Aug 30 20:38:10 HAWEB02 nrpe[10892]: Client request was invalid, bailing out...
Aug 30 20:41:51 HAWEB02 nrpe[10935]: Error: Request contained command arguments!
Aug 30 20:41:51 HAWEB02 nrpe[10935]: Client request was invalid, bailing out...
Aug 30 20:43:08 HAWEB02 nrpe[10961]: Error: Request contained command arguments!
Aug 30 20:43:08 HAWEB02 nrpe[10961]: Client request was invalid, bailing out...
Aug 30 20:46:48 HAWEB02 nrpe[11026]: Error: Request contained command arguments!
Aug 30 20:46:48 HAWEB02 nrpe[11026]: Client request was invalid, bailing out...
Aug 30 20:48:06 HAWEB02 nrpe[11076]: Error: Request contained command arguments!
Aug 30 20:48:06 HAWEB02 nrpe[11076]: Client request was invalid, bailing out...
Aug 30 20:51:46 HAWEB02 nrpe[11215]: Error: Request contained command arguments!
Aug 30 20:51:46 HAWEB02 nrpe[11215]: Client request was invalid, bailing out...
Aug 30 20:53:03 HAWEB02 nrpe[11238]: Error: Request contained command arguments!
Aug 30 20:53:03 HAWEB02 nrpe[11238]: Client request was invalid, bailing out...
Aug 30 20:56:45 HAWEB02 nrpe[11290]: Error: Request contained command arguments!
Aug 30 20:56:45 HAWEB02 nrpe[11290]: Client request was invalid, bailing out...
Aug 30 20:58:00 HAWEB02 nrpe[11308]: Error: Request contained command arguments!
Aug 30 20:58:00 HAWEB02 nrpe[11308]: Client request was invalid, bailing out...
Aug 30 21:01:44 HAWEB02 nrpe[11381]: Error: Request contained command arguments!
Aug 30 21:01:44 HAWEB02 nrpe[11381]: Client request was invalid, bailing out...
Aug 30 21:02:06 HAWEB02 systemd[1]: Stopping LSB: Start/Stop the Nagios remote plugin execution daemon...
Aug 30 21:02:06 HAWEB02 nagios-nrpe-server[11407]: * Stopping nagios-nrpe nagios-nrpe
Aug 30 21:02:06 HAWEB02 nagios-nrpe-server[11407]: ...done.
Aug 30 21:02:06 HAWEB02 systemd[1]: Stopped LSB: Start/Stop the Nagios remote plugin execution daemon.
Aug 30 21:02:06 HAWEB02 systemd[1]: Starting LSB: Start/Stop the Nagios remote plugin execution daemon...
Aug 30 21:02:06 HAWEB02 nagios-nrpe-server[11412]: * Starting nagios-nrpe nagios-nrpe
Aug 30 21:02:06 HAWEB02 nrpe[11416]: Starting up daemon
Aug 30 21:02:06 HAWEB02 nrpe[11416]: There's already an NRPE server running (PID 1026). Bailing out...
Aug 30 21:02:06 HAWEB02 nagios-nrpe-server[11412]: ...done.
Aug 30 21:02:06 HAWEB02 systemd[1]: Started LSB: Start/Stop the Nagios remote plugin execution daemon.
Aug 30 21:02:35 HAWEB02 nrpe[11457]: Error: Request contained command arguments!
Aug 30 21:02:35 HAWEB02 nrpe[11457]: Client request was invalid, bailing out...
Aug 30 21:02:35 HAWEB02 nrpe[11463]: Error: Request contained command arguments!
Aug 30 21:02:35 HAWEB02 nrpe[11463]: Client request was invalid, bailing out...
Aug 30 21:07:31 HAWEB02 nrpe[11584]: Error: Request contained command arguments!
Aug 30 21:07:31 HAWEB02 nrpe[11584]: Client request was invalid, bailing out...
Aug 30 21:07:32 HAWEB02 nrpe[11591]: Error: Request contained command arguments!
Aug 30 21:07:32 HAWEB02 nrpe[11591]: Client request was invalid, bailing out...
Aug 30 21:11:31 HAWEB02 nrpe[11716]: Starting up daemon
Aug 30 21:11:31 HAWEB02 nrpe[11716]: Server listening on 0.0.0.0 port 5666.
Aug 30 21:11:31 HAWEB02 nrpe[11716]: Server listening on :: port 5666.
Aug 30 21:11:31 HAWEB02 nrpe[11716]: Listening for connections on port 0
Aug 30 21:11:31 HAWEB02 nrpe[11716]: Allowing connections from: 127.0.0.1, 137.116.82.129
Aug 30 21:12:26 HAWEB02 nrpe[11740]: Error: Request contained command arguments!
Aug 30 21:12:26 HAWEB02 nrpe[11740]: Client request was invalid, bailing out...
Aug 30 21:12:26 HAWEB02 nrpe[11738]: Error: Request contained command arguments!
Aug 30 21:12:26 HAWEB02 nrpe[11738]: Client request was invalid, bailing out...
Aug 30 21:16:29 HAWEB02 systemd[1]: Started Session 18 of user GIRU.
Aug 30 21:17:01 HAWEB02 CRON[11888]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Aug 30 21:17:26 HAWEB02 nrpe[11903]: Error: Request contained command arguments!
Aug 30 21:17:26 HAWEB02 nrpe[11903]: Client request was invalid, bailing out...
Aug 30 21:17:26 HAWEB02 nrpe[11905]: Error: Request contained command arguments!
Aug 30 21:17:26 HAWEB02 nrpe[11905]: Client request was invalid, bailing out...
Aug 30 21:22:25 HAWEB02 nrpe[12005]: Error: Request contained command arguments!
Aug 30 21:22:25 HAWEB02 nrpe[12005]: Client request was invalid, bailing out...
Aug 30 21:22:26 HAWEB02 nrpe[12007]: Error: Request contained command arguments!
Aug 30 21:22:26 HAWEB02 nrpe[12007]: Client request was invalid, bailing out...
Aug 30 21:22:32 HAWEB02 systemd[1]: proc-sys-fs-binfmt_misc.automount: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 12014 (find)
Aug 30 21:22:32 HAWEB02 systemd[1]: Mounting Arbitrary Executable File Formats File System...
Aug 30 21:22:32 HAWEB02 systemd[1]: Mounted Arbitrary Executable File Formats File System.
Aug 30 21:24:09 HAWEB02 systemd[1]: Stopping LSB: Start/Stop the Nagios remote plugin execution daemon...
Aug 30 21:24:09 HAWEB02 nagios-nrpe-server[12064]: * Stopping nagios-nrpe nagios-nrpe
Aug 30 21:24:09 HAWEB02 nagios-nrpe-server[12064]: ...done.
Aug 30 21:24:09 HAWEB02 systemd[1]: Stopped LSB: Start/Stop the Nagios remote plugin execution daemon.
Aug 30 21:24:09 HAWEB02 systemd[1]: Starting LSB: Start/Stop the Nagios remote plugin execution daemon...
Aug 30 21:24:09 HAWEB02 nagios-nrpe-server[12070]: * Starting nagios-nrpe nagios-nrpe
Aug 30 21:24:09 HAWEB02 nrpe[12074]: Starting up daemon
Aug 30 21:24:09 HAWEB02 nrpe[12074]: There's already an NRPE server running (PID 11716). Bailing out...
Aug 30 21:24:09 HAWEB02 nagios-nrpe-server[12070]: ...done.
Aug 30 21:24:09 HAWEB02 systemd[1]: Started LSB: Start/Stop the Nagios remote plugin execution daemon.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Install nrpe on Ubuntu

Post by tgriep »

Can you upload this file from that server so we can view it?

Code: Select all

/etc/init.d/nagios-nrpe-server
Also, run this as root and post the output here as well

Code: Select all

ps -ef --cols=300
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 »

Both files are attached..
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Install nrpe on Ubuntu

Post by tgriep »

Try running the following to kill off the nrpe daemon and start a new one.

Code: Select all

killall -9 nrpe
/etc/init.d/nagios-nrpe-server start
Then take a look at the syslog and see if you are still setting the command arguments error.
If so, post this file.

Code: Select all

/etc/nagios/nrpe.cfg
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 »

I did the same, so I received Nagios (Return code of 255 is out of bounds) error message

root@HAWEB02:/home/GIRU# killall -9 nrpe

root@HAWEB02:/home/GIRU# /etc/init.d/nagios-nrpe-server start

[ ok ] Starting nagios-nrpe-server (via systemctl): nagios-nrpe-server.service.

Nagios (Return code of 255 is out of bounds)

root@HAWEB02:/home/GIRU#
root@HAWEB02:/home/GIRU# ps -ef|grep nrpe
root 21935 21723 0 07:45 pts/0 00:00:00 grep --color=auto nrpe

root@HAWEB02:/home/GIRU# netstat -an |grep 5666

I checked nagios process, which was not running, so I started it manually after that I am getting the same error message.
I have attached syslogs and /etc/nagios/nrpe.cfg file.

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

root@HAWEB02:/home/GIRU# /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d

root@HAWEB02:/home/GIRU# netstat -an |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
tcp6 0 0 :::5666 :::* LISTEN
root@HAWEB02:/home/GIRU# /etc/init.d/nagios-nrpe-server stop
[ ok ] Stopping nagios-nrpe-server (via systemctl): nagios-nrpe-server.service

tail -50 /var/log/syslog

Code: Select all

Aug 31 07:38:56 HAWEB02 systemd[1]: Started Session 35 of user GIRU.
Aug 31 07:39:38 HAWEB02 systemd[1]: Started LSB: Start/Stop the Nagios remote plugin execution daemon.
Aug 31 07:44:48 HAWEB02 nrpe[21850]: Starting up daemon
Aug 31 07:44:48 HAWEB02 nrpe[21850]: Server listening on 0.0.0.0 port 5666.
Aug 31 07:44:48 HAWEB02 nrpe[21850]: Server listening on :: port 5666.
Aug 31 07:44:48 HAWEB02 nrpe[21850]: Listening for connections on port 0
Aug 31 07:44:48 HAWEB02 nrpe[21850]: Allowing connections from: 127.0.0.1,137.116.82.129
Aug 31 07:45:12 HAWEB02 nrpe[21865]: Error: Request contained command arguments!
Aug 31 07:45:12 HAWEB02 nrpe[21865]: Client request was invalid, bailing out...
Aug 31 07:45:12 HAWEB02 nrpe[21871]: Error: Request contained command arguments!
Aug 31 07:45:12 HAWEB02 nrpe[21871]: Client request was invalid, bailing out...
Aug 31 07:45:53 HAWEB02 systemd[1]: Started LSB: Start/Stop the Nagios remote plugin execution daemon.
Aug 31 07:46:23 HAWEB02 nrpe[21948]: Starting up daemon
Aug 31 07:46:23 HAWEB02 nrpe[21948]: Server listening on 0.0.0.0 port 5666.
Aug 31 07:46:23 HAWEB02 nrpe[21948]: Server listening on :: port 5666.
Aug 31 07:46:23 HAWEB02 nrpe[21948]: Listening for connections on port 0
Aug 31 07:46:23 HAWEB02 nrpe[21948]: Allowing connections from: 127.0.0.1,137.116.82.129
Aug 31 07:46:36 HAWEB02 systemd[1]: Stopping LSB: Start/Stop the Nagios remote plugin execution daemon...
Aug 31 07:46:36 HAWEB02 nagios-nrpe-server[21974]: * Stopping nagios-nrpe nagios-nrpe
Aug 31 07:46:36 HAWEB02 nagios-nrpe-server[21974]: ...done.
Aug 31 07:46:36 HAWEB02 systemd[1]: Stopped LSB: Start/Stop the Nagios remote plugin execution daemon.
Aug 31 07:46:58 HAWEB02 nrpe[22023]: Error: Request contained command arguments!
Aug 31 07:46:58 HAWEB02 nrpe[22023]: Client request was invalid, bailing out...
Aug 31 07:46:58 HAWEB02 nrpe[22025]: Error: Request contained command arguments!
Aug 31 07:46:58 HAWEB02 nrpe[22025]: Client request was invalid, bailing out...
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Install nrpe on Ubuntu

Post by tgriep »

All of the commands that are in the nrpe.cfg file already have arguments defined for them so when you try and run that check from the Nagios server with an argument, you are doubling the arguments and causing the error.
So, if you do not specify the arguments for the commands on the XI server, it should work for you.
Or you can edit the nrep.cfg file and remove the hard coded arguments and change them like the example below.
Change this from

Code: Select all

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
to

Code: Select all

command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
Restart the nrpe daemon and then you can specify the arguments on the Nagios server's commands.
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 »

I have removed arguments from nagios server, and its working fine.

Although check_memory plugin is working fine for all other servers, but on one server its giving very awkward error,

check_memory not defined in nrpe.cfg
You do not have the required permissions to view the files attached to this post.
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post by Naveed »

One more thing, I have instantly check, multiple nagios.cfg processes are running on server side.

[root@AXmonitor libexec]# ps -ef|grep nagios.cfg
nagios 57057 1 9 13:10 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 57074 57057 0 13:10 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 57079 44880 0 13:10 pts/0 00:00:00 grep --color=auto nagios.cfg


I have killed both processes and restarted nagios service.
Still two nagios processes are running?

How can I kill 2 processes, one nagios process should run at a time.
Can these 2 processes causes our subjected behavior?

Thank you!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Install nrpe on Ubuntu

Post by rkennedy »

I don't think the issue is with the nagios processes, but more with how NRPE is running on the Ubuntu machine. Please post the output of these commands ran on the Ubuntu machine -

Code: Select all

ps -ef
locate nrpe
Former Nagios Employee
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 »

Naveed wrote:One more thing, I have instantly check, multiple nagios.cfg processes are running on server side.

[root@AXmonitor libexec]# ps -ef|grep nagios.cfg
nagios 57057 1 9 13:10 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 57074 57057 0 13:10 ? 00:00:00 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 57079 44880 0 13:10 pts/0 00:00:00 grep --color=auto nagios.cfg


I have killed both processes and restarted nagios service.
Still two nagios processes are running?

How can I kill 2 processes, one nagios process should run at a time.
Can these 2 processes causes our subjected behavior?

Thank you!
The first process has the PID 57057, this is the parent process.
The second process has the PID 57074 and is a child of 57057, this is normal and OK. There would only be an issue if the second process was not a child of the parent process.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked