Nagios /dev/sdb1: No such file or directory

Jaffa Cakes!

Limp Gawd
Joined
Oct 13, 2007
Messages
136
Hey,

So I am monitoring a few Linux servers using Nagios but I've hit a snag with disk space. I've set it up like so:

Code:
define command{
        command_name check_disk
        command_line $USER1$/check_disk $ARG1$
        }

Code:
define service{
          use                 generic-service
          host_name           Diamond
          service_description /dev/sdb1 Free Space on HOME
          check_command       check_disk!/dev/sdb1
          }

But Nagios is just reporting that it cannot check /dev/sdb1 because the directory does not exist (I know it does, it's where our /home is residing on one of our remove servers!). We're using NRPE.

Any ideas?
 
Give it /home rather than /dev/sdb1. It takes mount points rather than partitions.
 
Thanks, I tried it though and they're all reporting the same free space, even though I know this isn't true.

Also, I'd like to know the same as freezervv :p
 
How is the disk check command defined in commands.cfg? You specify commands in there on an object, not directly reference commands.

Does it run correctly from shell with the output you'd expect?

Mine is set like this, 10% being warning and 5% critical alarm.

Commands.cfg:
Code:
define command{
          command_name    check_local_disk
          command_line    $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
        }
Server Object
Code:
define service{
        use                             local-service,srv-pnp
        host_name                       xxxxxx
        service_description             /home Partition
        check_command            check_local_disk!10%!5%!/home
        }
 
Just noticed you're using NRPE to check a remote disk so on the nagios box.

Commands.cfg
Code:
define command{
    command_name check_nrpe
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
    }
Server Object
Code:
define service{
        use                             npre-service,srv-pnp
        host_name                       xxxxxxxx
        service_description             /home Free Space
        check_command                   check_nrpe!check_sda5
}
On the server being checked nrpe.cfg.

Code:
command[check_sda5]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda5

Had to jog my memory but the -p switch lets you specify partition rather than mount point.
 
Back
Top