Checj_disk not working correctly
Posted: Sun Sep 14, 2014 10:28 pm
Hello Everyone
I have been using Nagios Core to monitor my servers for about a year now my manager wanted me to show the disk reporting in a way that was easier for him to read. I descided to use check_disk with the -p option to monitor and show each LV mount point. Here is the command definition entry of one of the commands I created that I placed in the commands.cfg file.
# 'check_disk_slash' command definition
define command{
command_name check_disk_slash
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
Here is the command I put in the npre.cfg on the server I am monitoring.
command[check_disk_slash]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
On the server with Nagios Core running here is the command I put in the server config file.
define service{
use local-service ; Name of service template to use
host_name MyServerHostname
service_description Disk Usage /
check_command check_disk_slash!20%!10%!/
notifications_enabled 1
max_check_attempts 3
check_interval 5
retry_interval 3
check_period 24x7
notification_interval 15
notification_period 24x7
notification_options w,c,r
# contact_groups ux-admins
register 1
}
Here is were my problem is Nagios reports the same information on the web page for all the mount points.
DISK OK - free space: / 13177 MB (95% inode=99%):
However, if I run the check from the Nagios monitoing server manually with the check_disk_slash command that I created I get the correct answer.
./check_nrpe -H MyServerHostname -c check_disk_slash
DISK OK - free space: / 8653 MB (94% inode=99%);| /=519MB;7736;8703;0;9671
Here is what a df -k shows on the server
/dev/mapper/vg00-lvol00
9903432 531560 8860692 6% /
I am running Nagios Core 4.0.7
npre 2.13 client server
nagiosplugins 1.4.15 client server
Does anyone see any thing I did wrong if so any help will greatly be appreciated. Thanks in advance for any help.
I have been using Nagios Core to monitor my servers for about a year now my manager wanted me to show the disk reporting in a way that was easier for him to read. I descided to use check_disk with the -p option to monitor and show each LV mount point. Here is the command definition entry of one of the commands I created that I placed in the commands.cfg file.
# 'check_disk_slash' command definition
define command{
command_name check_disk_slash
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
Here is the command I put in the npre.cfg on the server I am monitoring.
command[check_disk_slash]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
On the server with Nagios Core running here is the command I put in the server config file.
define service{
use local-service ; Name of service template to use
host_name MyServerHostname
service_description Disk Usage /
check_command check_disk_slash!20%!10%!/
notifications_enabled 1
max_check_attempts 3
check_interval 5
retry_interval 3
check_period 24x7
notification_interval 15
notification_period 24x7
notification_options w,c,r
# contact_groups ux-admins
register 1
}
Here is were my problem is Nagios reports the same information on the web page for all the mount points.
DISK OK - free space: / 13177 MB (95% inode=99%):
However, if I run the check from the Nagios monitoing server manually with the check_disk_slash command that I created I get the correct answer.
./check_nrpe -H MyServerHostname -c check_disk_slash
DISK OK - free space: / 8653 MB (94% inode=99%);| /=519MB;7736;8703;0;9671
Here is what a df -k shows on the server
/dev/mapper/vg00-lvol00
9903432 531560 8860692 6% /
I am running Nagios Core 4.0.7
npre 2.13 client server
nagiosplugins 1.4.15 client server
Does anyone see any thing I did wrong if so any help will greatly be appreciated. Thanks in advance for any help.