Nagios not able to monitor the linux partition

Hi all

   i have installed and configure nagios in my rhel 5 box.Now i wannt to monitor my squid partition.But my nagios is giving incorrect output in webinterface.

[root@squid-cgi /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 38G 30G 6.5G 82% /
/dev/sda1 99M 9.9M 84M 11% /boot
tmpfs 1.7G 0 1.7G 0% /dev/shm
/dev/sda4 19G 2.4G 16G 14% /cache

i wannt to monitor /dev/sda2 and /dev/sda4 of my squid server

my services.cfg

define service{
host_name squid-cgi
service_description Root Partition
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups Domain-Admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_disk
}

define service{
host_name squid-cgi
service_description Squid Cache
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups Domain-Admins
notification_interval 120
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_disk
}

my nrpe.cfg

command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/sda4
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/sda2

nagios webinterface
Root Partition

OK 12-17-2008 17:10:12 18d 4h 0m 4s 1/4 DISK OK - free space: / 6639 MB (18% inode=80%):
Squid Cache

OK 12-17-2008 17:10:55 0d 4h 22m 25s 1/4 DISK OK - free space: / 6639 MB (18% inode=80%):

can anyone help me to solve this problem.thanks in advance.

I had a similar problem for a quite a while. Finally figured out that the check_disk command checks the local disk, not the remote disk of the servers. You need to use NRPE or SNMP to monitor remote disk. I prefer using SNMP (need to install SNMP plugin check_snmp_storage) over NPRE.

I figure as you define check_disk twice and call it from both service checks, it’s always going to use the second definition and read sda2. I would try reconfiguring the check_disk definitions as check_disk2 and check_disk4 for sda2 and sda4 and then using those in your service definition - i.e. for your root partition use:
check_command check_nrpe!check_disk2

HTH

/S

*oh, don’t forget to restart nagios and nrpe… :wink: