today I installed an ubuntu with nrpe and it worked because I enabled the root user.
On 3 previous ubuntu's, it is not working because the root is disabled.
here is the error:
Code: Select all
cd /usr/lib/nagios/plugins/
@NE8:/usr/lib/nagios/plugins$ sudo -s -u nagios ./check_nrpe -H 127.0.0.1 -c check_disk
NRPE: Unable to read output
either the path nrpe.cfg is wrong or there is a permission problem.
according to
https://serverfault.com/questions/32323 ... ut-but-why
Code: Select all
nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/
I am reluctant to do that as in the past i played with the sudoers file and it stopped being accessed! I had to use the ubuntu cd to edit it and this is dangerous in a production environment.
do you confirm that this is the problem?
config of /etc/nagios/nrpe.cfg
Code: Select all
allowed_hosts=127.0.0.1, 10.10.10.12
command[check_users]=sudo /usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_load]=sudo /usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_disk]=sudo /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/sda3
command[check_zombie_procs]=sudo /usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=sudo /usr/lib/nagios/plugins/check_procs -w 150 -c 200
command[check_swap]=sudo /usr/lib/nagios/plugins/check_swap -w 20 -c 10
command[check_mem]=sudo /usr/lib/nagios/plugins/check_mem.pl -u -w 80 -c 90
command[check_cpu]=sudo /usr/lib/nagios/plugins/check_cpu.sh -i 5 -w 80 -c 90
Code: Select all
ls -l /etc/nagios
total 20
-rwxr-xr-x 1 nagios nagios 8240 июл 5 12:56 nrpe.cfg
drwxr-xr-x 2 nagios nagios 4096 май 8 19:01 nrpe.d
-rwxr-xr-x 1 nagios nagios 117 май 8 19:00 nrpe_local.cfg
Code: Select all
ls -l /usr/lib/nagios/
total 4
drwxr-xr-x 2 nagios nagios 4096 июл 5 12:24 plugins
Code: Select all
sudo ps cax | grep nrpe
12473 ? Ss 0:00 nrpe