Step 1 : Edit /etc/nagios/checkcommands.cfg:
# 'check_local_disk' command definition
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
Step 2 : open up /etc/nagios/commands.cfg
# Command used to check disk space usage on local partitions
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
Note : commands.cfg entry can be copied directly from checkcommands.cfg
Step 3 : edit /etc/nagios/services-servers.cfg
# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.
define service{
use generic-service ; Name of service template to use
host_name hostname.com
service_description Home Partition
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_options w,u,c,r
notification_interval 960
notification_period 24x7
check_command check_local_disk!20%!10%!/home
}
Step : 4 Try to test your configuration
#nagios -v nagios.cfg
Step 5 : Restart Nagios
#/etc/init.d/nagios restart
Step 1 : iimdns.iimahd.ernet.in DNS servers specified in the IP
#/usr/local/nagios/libexec/check_dns -s Ipaddrss -h imdns.iimahd.ernet.in
Step 2 : Checkcommands.cfg file
#vi /usr/local /nagios/etc/checkcommands.cfg
# 'Check_dns' command definition
define command (
command_name check_dns
command_line $ USER1 $ / check_dns-s $ HOSTADDRESS $-H $ ARG1 $
)
#Definition of Service
define service (
use generic-service
host_name hoge
service_description DNS imdns.iimahd.ernet.in
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
notification_interval 240
notification_period 24x7
notification_options c, r
check_command check_dns! imdns.iimahd.ernet.in
contact_groups linux-admins
)