NRPE check_disk performance data is wrong.

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
ray.holtz
Posts: 9
Joined: Tue Aug 25, 2015 11:24 am

NRPE check_disk performance data is wrong.

Post by ray.holtz »

when I run check_disk on the Ubuntu 16.04 being monitored (apt-get fully up to date), I receive:

Code: Select all

user@server:/var/log/apache2/sites$ /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vgpool--logs-lv--logs
DISK OK - free space: /var/log/apache2/sites 21691 MB (99% inode=99%);| /var/log/apache2/sites=169MB;18443;20748;0;23054
and 'df -h' backs that up with:

Code: Select all

user@server:/var/log/apache2/sites$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
<snip out irrelevant data>
/dev/mapper/vgpool--logs-lv--logs   23G  170M   22G   1% /var/log/apache2/sites
And nrpe.cfg has this:

Code: Select all

command[check_logs]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vgpool--logs-lv--logs
When I run the check on the Nagios server (Ubuntu 12.04) the data being received is all wrong:

Code: Select all

user@server2:/etc/nagios3/objects/servers/linux$ /usr/lib/nagios/plugins/check_nrpe -H 10.10.5.21 -c check_logs
DISK CRITICAL - free space: /var/log/apache2/sites 0 MB (0% inode=0%);| /var/log/apache2/sites=17508311532424MB;-2147483648;-2147483648;0;17508311532480
Here are the versions on the Nagios server:

Code: Select all

user@server2:/etc/nagios3/objects/servers/linux$ dpkg -l | grep '^ii' | grep nagios
ii  nagios-images                    0.7                               Collection of images and icons for the nagios system
ii  nagios-nrpe-plugin               2.12-5ubuntu1.2                   Nagios Remote Plugin Executor Plugin
ii  nagios-nrpe-server               2.12-5ubuntu1.2                   Nagios Remote Plugin Executor Server
ii  nagios-plugins                   1.4.15-5ubuntu3.2                 Plugins for nagios compatible monitoring systems (metapackage)
ii  nagios-plugins-basic             1.4.15-5ubuntu3.2                 Plugins for nagios compatible monitoring systems
ii  nagios-plugins-extra             1.4.15-5ubuntu3.2                 Plugins for the nagios network monitoring and manegement system.
ii  nagios-plugins-standard          1.4.15-5ubuntu3.2                 Plugins for nagios compatible monitoring systems
ii  nagios-snmp-plugins              1.1.1-7                           SNMP Plugins for nagios
ii  nagios3                          3.2.3-3ubuntu1.1                  A host/service/network monitoring and management system
ii  nagios3-cgi                      3.2.3-3ubuntu1.1                  cgi files for nagios3
ii  nagios3-common                   3.2.3-3ubuntu1.1                  support files for nagios3
ii  nagios3-core                     3.2.3-3ubuntu1.1                  A host/service/network monitoring and management system core files
ROYALCORP\rholtz@rovsubuntu1:/etc/nagios3/objects/servers/linux$
Is it just that the packages on the Nagios server are out of date, or is there an error somewhere? Thanks for the help!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRPE check_disk performance data is wrong.

Post by scottwilkerson »

does the nagios user have access to the path?

Can you run this from the CLI on the local machine

Code: Select all

sudo su nagios -c "/var/log/apache2/sites$ /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vgpool--logs-lv--logs"
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ray.holtz
Posts: 9
Joined: Tue Aug 25, 2015 11:24 am

Re: NRPE check_disk performance data is wrong.

Post by ray.holtz »

Thanks Scott, that was it partially, the nagios user doesn't have permissions to see that. I'm trying to figure out where/how to give it permissions, but it's not working out right for me. I put the nagios user in the www-data group, and gave that group rights to the /var/log/apache2 directory recursively. but now I get:

Code: Select all

user@server:/var/log$ sudo su nagios -c "/var/log/apache2/sites$ /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vgpool--logs-lv--logs"
bash: /var/log/apache2/sites$: No such file or directory
What can't it find exactly, I'm a little confused.

Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRPE check_disk performance data is wrong.

Post by scottwilkerson »

I'm sorry I copied the command wrong...
Try this

Code: Select all

sudo su nagios -c "/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/vgpool--logs-lv--logs"
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ray.holtz
Posts: 9
Joined: Tue Aug 25, 2015 11:24 am

Re: NRPE check_disk performance data is wrong.

Post by ray.holtz »

At first it only worked on the local server, but not on the Nagios server... then I restarted NRPE on the local server and it works great now! Thanks Scott!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRPE check_disk performance data is wrong.

Post by scottwilkerson »

ray.holtz wrote:At first it only worked on the local server, but not on the Nagios server... then I restarted NRPE on the local server and it works great now! Thanks Scott!
Oh ya, sorry I forgot to mention restarting nrpe....

Glad it is working!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked