Monitor another partition on local machine?


I have a linux server running Nagios 3.0rc1. In the sample localhost.cfg is a service to “check_local_disk” which is great to monitor disk space on the root partition. How can I configure the service to monitor an additional partition on the local machine? For example, the /home partition?


by default, the check_local_disk is defined as:

‘check_local_disk’ command definition

define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

If you launch check_disk without any args, you’ll see that the option -p stands for “path”.
Meaning that you just have to put /home as the 3rd argument :slight_smile:

=> check_command check_local_disk!50!60!/home


Simply add the additional check in localhost.cfg changing the service_description and check_command as indicated below:

define service{
use local-service ; Name of service template to use
host_name localhost
service_description Home Partition
check_command check_local_disk!20%!10%!/home

and restart nagtios


Exactly the information I was looking for.

Many thanks!