0

To be sure I don't have any double definition of the command, I created a new debug command name in the nrpe config

/etc/nagios/nrpe.d # grep -R debug
debug.cfg:command[debug_check_disks]=/usr/lib/nagios/plugins/check_disk -w 20% -c 5% -C -w 10000 -c 5000 -p /home -p /

Executing it via nrpe plugin gives me a warning

/usr/lib/nagios/plugins/check_nrpe -H 127.0.0.1 -c debug_check_disks
DISK WARNING - free space: / 3190413 MB (11% inode=99%); /dev 15889 MB (100% inode=99%); /dev/shm 15921 MB (100% inode=99%); /run 3183 MB (99% inode=99%); /run/lock 5 MB (100% inode=99%); /run/user/0 3184 MB (100% inode=99%); /sys/fs/cgroup 15921 MB (100% inode=99%); /boot 306 MB (66% inode=99%); /tmp 3190413 MB (11% inode=99%); /var/tmp 3190413 MB (11% inode=99%);| /=23828329MB;28436835;28441835;0;28446835 /dev=0MB;12711;15094;0;15889 /dev/shm=0MB;12736;15124;0;15921 /run=0MB;2547;3024;0;3184 /run/lock=0MB;4;4;0;5 /run/user/0=0MB;2547;3024;0;3184 /sys/fs/cgroup=0MB;12736;15124;0;15921 /boot=154MB;388;461;0;486 /tmp=23828329MB;22757468;27024493;0;28446835 /var/tmp=23828329MB;22757468;27024493;0;28446835

But running it locally reports OK.

sudo -u nagios /usr/lib/nagios/plugins/check_disk -w 20% -c 5% -C -w 10000 -c 5000 -p /home -p /
DISK OK - free space: /dev 15889 MB (100% inode=99%); /run 3183 MB (99% inode=99%); / 3190413 MB (11% inode=99%); /dev/shm 15921 MB (100% inode=99%); /run/lock 5 MB (100% inode=99%); /sys/fs/cgroup 15921 MB (100% inode=99%); /boot 306 MB (66% inode=99%); /run/user/0 3184 MB (100% inode=99%);| /dev=0MB;12711;15094;0;15889 /run=0MB;2547;3024;0;3184 /=23828329MB;28436835;28441835;0;28446835 /dev/shm=0MB;12736;15124;0;15921 /run/lock=0MB;4;4;0;5 /sys/fs/cgroup=0MB;12736;15124;0;15921 /boot=154MB;388;461;0;486 /run/user/0=0MB;2547;3024;0;3184

nagios-nrpe-server is running under the user nagios (as per default)

ps -ef | grep nagios
nagios     75200       1  0 16:39 ?        00:00:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
root       75389   71365  0 16:45 pts/0    00:00:00 grep --color=auto nagios

Any ideas why this discrepancy? Thanks!

The server is running ubuntu 20.04.4 and was originally installed with ubuntu 16.06 and dist-upgraded twice.

1 Answer 1

0

NRPE server was running in systemd with the PrivateTmp=true option which added the tmp directories. I fixed it by adding /tmp and /var/tmp to the ignore list with the -i option. Another fix would be to disable PrivateTmp in the systemd service file,

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .