Check_nrpe displays mount point as /tmp or /var/tmp.

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ardouos
Posts: 2
Joined: Tue Nov 07, 2017 9:25 am

Check_nrpe displays mount point as /tmp or /var/tmp.

Post by ardouos »

Hello,

I think I found a bug when using NRPE version 3.2.1 that has been compiled. Unless I am doing something incorrect.
My issue is pretty much the same as: https://support.nagios.com/forum/viewto ... =7&t=40247

I do not currently see a bug open for it in the url posted: https://github.com/NagiosEnterprises/nrpe/issues

I have a Nagios core server running on CentOS 7 using the check_nrpe command to interrogate a Debian 9 machine for its disk space.

The partitions are as follows:

Code: Select all

root@debian-01:~# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0      2:0    1    4K  0 disk
sda      8:0    0   20G  0 disk
├─sda1   8:1    0   19G  0 part /
├─sda2   8:2    0    1K  0 part
└─sda5   8:5    0 1022M  0 part [SWAP]
sr0     11:0    1 1024M  0 rom
On the Debian machine's nrpe.conf I have the line:

Code: Select all

root@debian-01:/usr/local/nagios/libexec# cat /usr/local/nagios/etc/nrpe.cfg | grep check_root
command[check_root]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
And I run the check disk command on the machine and I get the correct displayed output

Code: Select all

root@debian-01:/usr/local/nagios/libexec# ./check_disk -w 20% -c 10% -p /dev/sda1
DISK OK - free space: / 13043 MB (72.33% inode=86%);| /=4989MB;15216;17118;0;19021
On the server OTOH.

Code: Select all

[root@nagios-srv ~]# /usr/local/nagios/libexec/check_nrpe -H debian-01 -c check_root
DISK OK - free space: /var/tmp 13043 MB (72.33% inode=86%);| /var/tmp=4989MB;17118;18069;0;19021
As you can see, the server is displaying the correct free space, but is showing /var/tmp rather than /.

Back on the Debian machine if I change /dev/sda1 to / in the nrpe config file like so:

Code: Select all

root@debian-01:/usr/local/nagios/libexec# cat /usr/local/nagios/etc/nrpe.cfg | grep check_root
command[check_root]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
As normal, the check disk plugin sees the displayed mount point as expected.

Code: Select all

root@debian-01:/usr/local/nagios/libexec# ./check_disk -w 20% -c 10% -p /
DISK OK - free space: / 13043 MB (72.33% inode=86%);| /=4989MB;15216;17118;0;19021
And now back on the server:

Code: Select all

[root@nagios-srv ~]# /usr/local/nagios/libexec/check_nrpe -H debian-01 -c check_root
DISK OK - free space: / 13043 MB (72.33% inode=86%);| /=4989MB;15216;17118;0;19021
Is there a reason for this?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_nrpe displays mount point as /tmp or /var/tmp.

Post by tgriep »

I think that when using the device as the path, when any of the partitions are in a warning or critical state, that partition will be displayed.
At the time the check was run, the /var/tmp partition may of exceeded the thresholds and it was displayed in the output.

If you change the command to use /dev/sda1, does it still display the /var/tmp partition?

Also, it could be a permission issue, the NRPE agent does not run as root and it may not have enough access to read the full /dev/sda1 device.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ardouos
Posts: 2
Joined: Tue Nov 07, 2017 9:25 am

Re: Check_nrpe displays mount point as /tmp or /var/tmp.

Post by ardouos »

tgriep wrote:I think that when using the device as the path, when any of the partitions are in a warning or critical state, that partition will be displayed.
At the time the check was run, the /var/tmp partition may of exceeded the thresholds and it was displayed in the output.

If you change the command to use /dev/sda1, does it still display the /var/tmp partition?

Thank you for replying.

I get the same issue when changing it back to /dev/sda1. The partition is in an OK state.

Code: Select all

[root@nagios-srv ~]# /usr/local/nagios/libexec/check_nrpe -H debian-01 -c check_root
DISK OK - free space: /var/tmp 13027 MB (72.24% inode=86%);| /var/tmp=5005MB;15216;17118;0;19021
tgriep wrote:Also, it could be a permission issue, the NRPE agent does not run as root and it may not have enough access to read the full /dev/sda1 device.
That would make sense. But wouldn't that affect all of the plugins on my clients instead of just the compiled ones?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_nrpe displays mount point as /tmp or /var/tmp.

Post by tgriep »

Some plugins do not need to be run at a elevated account so that will not cause an issue with all of the compiled plugins.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked