Page 4 of 5
Re: Install nrpe on Ubuntu
Posted: Wed Aug 31, 2016 4:49 pm
by Naveed
both files are attached.
Re: Install nrpe on Ubuntu
Posted: Wed Aug 31, 2016 4:51 pm
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....
Re: Install nrpe on Ubuntu
Posted: Wed Aug 31, 2016 4:57 pm
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.
Re: Install nrpe on Ubuntu
Posted: Wed Aug 31, 2016 5:04 pm
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
Re: Install nrpe on Ubuntu
Posted: Wed Aug 31, 2016 5:15 pm
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:
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
Re: Install nrpe on Ubuntu
Posted: Thu Sep 01, 2016 5:33 am
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!
Re: Install nrpe on Ubuntu
Posted: Thu Sep 01, 2016 12:54 pm
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.
Did this help?
Re: Install nrpe on Ubuntu
Posted: Fri Sep 02, 2016 9:09 am
by Naveed
No, this did not help me to solve my problem.
Thank you!
Re: Install nrpe on Ubuntu
Posted: Fri Sep 02, 2016 11:51 am
by rkennedy
Please post your nrpe.cfg for us to review once again.
Re: Install nrpe on Ubuntu
Posted: Thu Sep 08, 2016 7:00 am
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