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.
Checj_disk not working correctly
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Checj_disk not working correctly
What is currently happening is your command is checking the disk space on the local Nagios core host.
This is the command executed on the remote server. You've hard coded the warning, critical and mount point.
Then on your core server, your command definition should be:
This is the command executed on the remote server. You've hard coded the warning, critical and mount point.
It should be:rbri wrote:command[check_disk_slash]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
rbri wrote:command[check_disk_slash]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Then on your core server, your command definition should be:
And your service definition remains the same:rbri wrote:# 'check_disk_slash' command definition
define command{
command_name check_disk_slash
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk_slash -a $ARG1$ $ARG2$ $ARG3$
}
rbri wrote:check_command check_disk_slash!20%!10%!/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.