No matter what I do I cannot get check_disk to detect warnings or criticals.
commands.cfg looks like
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
host.cfg looks like
define service{
use local-service ; Name of service template to use
host_name hostname.com
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
The / volume is currently at 85% full. I should be getting a warning in nagios, but it doesn’t seem to be detecting it.
The Nagios Service State Information constantly reads:
Status Information: DISK OK - free space: / 67922 MB (99% inode=99%):
It shows this for ALL of my hosts.
My available disk space is actually 21G on a 138G drive.
Any ideas?
please post results of a df -kh
Edit: and ./check_disk -l
result of df -kh on target machine is:
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s10 138G 125G 13G 91% /
and the result of a ./check_disk -l on nagios machine is:
./check_disk -l
DISK OK - free space: / 67921 MB (99% inode=99%); /var/run 504 MB (99% inode=99%); /var/lock 504 MB (100% inode=99%); /proc/bus/usb 9 MB (99% inode=99%); /dev 9 MB (99% inode=99%); /dev/shm 504 MB (100% inode=99%); /lib/modules/2.6.17-10-powerpc/volatile 504 MB (99% inode=99%);| /=619MB;;;0;72209 /var/run=0MB;;;0;504 /var/lock=0MB;;;0;504 /proc/bus/usb=0MB;;;0;10 /dev=0MB;;;0;10 /dev/shm=0MB;;;0;504 /lib/modules/2.6.17-10-powerpc/volatile=0MB;;;0;504
That’s strange. It looks like the check_disk is not applying to the target machines. No wonder it keeps showing the same results for every host. The check_disk is showing the usage of the localhost.
here’s a result of a df on the localhost (nagios machine):
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 71G 620M 67G 1% /
varrun 505M 48K 505M 1% /var/run
varlock 505M 0 505M 0% /var/lock
procbususb 10M 92K 10M 1% /proc/bus/usb
udev 10M 92K 10M 1% /dev
devshm 505M 0 505M 0% /dev/shm
lrm 505M 268K 505M 1% /lib/modules/2.6.17-10-powerpc/volatile
Why won’t the check_disk apply to the target machine?
it’s only a local check. If you do a ./check_disk --help you will see no parameter for hostname/ipaddress…
You need to implement something like NRPE to perform checks on remote *nix boxes… see the nagios documentation on remote *nix checks at nagios.sourceforge.net/docs/nrpe/NRPE.pdf
HTH
/S