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 »

both files are attached.
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 »

Ok @Box293

But why I am getting check_memory command not defined error.

plugin exist, command defined, running on client side successfully.

Its behaving abnormally on one server only....
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Install nrpe on Ubuntu

Post by tgriep »

Is the nrpe.cfg file you posted a few days ago from the server that is having the issue?
If not, can you post it.
Also, post the command you are running on the Nagios server.
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 »

nrpe.cfg
=======
log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,1.2.3.4
dont_blame_nrpe=1
allow_bash_command_substitution=0
debug=0
command_timeout=60
connection_timeout=300
#allow_weak_random_seed=1


#######Commands###########################
##############################################################################################

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_cpu]=/usr/lib/nagios/plugins/check_cpu -c 05 -w 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_procs]=/usr/lib/nagios/plugins/check_procs -w 400 -c 500
command[check_ssh]=/usr/lib/nagios/plugins/check_ssh -H 127.0.0.1 -p22
command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 30 -c 20
command[check_memory]=/usr/lib/nagios/plugins/check_memory -f -w 8 -c 5
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 08% -c 05% -p /
command[check_ntp]=/usr/lib/nagios/plugins/check_ntp -H 127.0.0.1 -w 10 -c 20
command[check_uptime]=/usr/lib/nagios/plugins/check_uptime
command[check_tcp22]=/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 22 -w 30 -c 20
command[check_tcp5666]=/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 5666 -w 30 -c 20
command[check_open_files]=/usr/lib/nagios/plugins/check_open_files -c 30 -w 50
command[check_memory]=/usr/lib/nagios/plugins/check_memory -f -w 08 -c 05

command on client side:

root@HADB01:/home/GIRU# /usr/lib/nagios/plugins/check_memory -f -w 8 -c 5
OK - 85.0% (24500848 kB) free.|TOTAL=28810492KB;;;; USED=4309644KB;26505652;27369967;; FREE=24500848KB;;;; CACHES=1892548KB;;;;

command on server side

[root@AXmonitor vmn]# /usr/local/nagios/libexec/check_nrpe -H 2.3.5.6 -p 5666 -c check_memory
NRPE: Command 'check_memory' not defined
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 »

In your locate nrpe.txt file I see the following:

/etc/nagios/nrpe.cfg
/usr/local/nagios/etc/nrpe.cfg
/etc/xinetd.d/nrpe

In your ps -ef.txt file I see the following:

nagios 34824 1 0 21:08 ? 00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root 51453 1 0 14:36 ? 00:00:00 /usr/sbin/xinetd -pidfile /run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6

You would assume that /etc/nagios/nrpe.cfg is the file that is being used, however I also see that NRPE is running via xinetd which makes me think that you have two separate copies of NRPE running / trying to run.

This command:

Code: Select all

mv /etc/xinetd.d/nrpe /var/tmp/
Will stop xinetd from running an instance of nrpe. You may need to restart the xinetd service.
You should then make any changes to /etc/nagios/nrpe.cfg
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 »

I did the same

mv /etc/xinetd.d/nrpe /var/tmp/

and /etc/init.d/xinetd restart

I got (Return code of 255 is out of bounds) error on all services and nrpe was listening on tcp only

root@HADB01:/var/tmp# netstat -an |grep 5666
tcp6 0 0 :::5666 :::* LISTEN

I revert the change and, now nrpe is listening as

root@HADB01:/var/tmp# netstat -an |grep 5666
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN
tcp6 0 0 :::5666 :::* LISTEN

After revert that change, still getting check_memory command not defined.

Kindly suggest.

Thank you!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Install nrpe on Ubuntu

Post by lmiltchev »

In the "nrpe.cfg" you have the "check_memory" command defined twice.
command[check_memory]=/usr/lib/nagios/plugins/check_memory -f -w 8 -c 5
command[check_memory]=/usr/lib/nagios/plugins/check_memory -f -w 08 -c 05
Remove the bottom one, and restart xinetd.

Code: Select all

service xinetd restart
Did this help?
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 »

No, this did not help me to solve my problem.
Thank you!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Install nrpe on Ubuntu

Post by rkennedy »

Please post your nrpe.cfg for us to review once again.
Former Nagios Employee
Naveed
Posts: 285
Joined: Mon May 30, 2016 10:10 am

Re: Install nrpe on Ubuntu

Post by Naveed »

Code: Select all

############################################################################################
#       NRPE Customized 
############################################################################################
log_facility=daemon
pid_file=/var/run/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,1.2.3.4
dont_blame_nrpe=1
allow_bash_command_substitution=0
debug=0
command_timeout=60
connection_timeout=300
#allow_weak_random_seed=1


#######Commands###########################
##############################################################################################

command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_cpu]=/usr/lib/nagios/plugins/check_cpu -c 05  -w 10
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_procs]=/usr/lib/nagios/plugins/check_procs -w 400 -c 500
command[check_ssh]=/usr/lib/nagios/plugins/check_ssh -H 127.0.0.1 -p22
command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 30 -c 20
command[check_memory]=/usr/lib/nagios/plugins/check_memory -f -w 8 -c 5
command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 08% -c 05% -p /
command[check_ntp]=/usr/lib/nagios/plugins/check_ntp -H 127.0.0.1 -w 10 -c 20
command[check_uptime]=/usr/lib/nagios/plugins/check_uptime
command[check_tcp22]=/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 22 -w 30 -c 20
command[check_tcp5666]=/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 5666 -w 30 -c 20
command[check_open_files]=/usr/lib/nagios/plugins/check_open_files -c 30 -w 50
command[check_mem]=/usr/lib/nagios/plugins/check_mem -w 80 -c 90
Last edited by tmcdonald on Thu Sep 08, 2016 9:43 am, edited 1 time in total.
Reason: Please use [code][/code] tags around config output
Locked