Hi,
I have configured Nagios on SLES 10 SP2. I could configure nagios but 2 things are not working correctly.
1. It doesn’t show correct disk utilization for /local partition.
2. It doesn’t send Alerts.
I have installed NAGIOS (nagios-3.2.0-11.1, nagios-plugins-1.4.14-11.1 and few other which are required to remove dependency) on server and I have installed nagios (nagios-plugins-1.4.14-11.1, nagios-nrpe-client-2.12-11.1 and few other packages to remove dependency) on client.
Configuration files from NAGIOS server:
nagios.cfg (Since this file is big, I have copied the relevant portion only. Let me know if any specific info is required from this file)=>
log_file=/var/log/nagios/nagios.log
cfg_file=/etc/nagios/objects/commands.cfg
cfg_file=/etc/nagios/objects/contacts.cfg
cfg_file=/etc/nagios/objects/contactgroups.cfg
cfg_file=/etc/nagios/objects/timeperiods.cfg
cfg_file=/etc/nagios/objects/templates.cfg
cfg_file=/etc/nagios/objects/hosts.cfg
cfg_file=/etc/nagios/objects/hostgroups.cfg
cfg_file=/etc/nagios/objects/services.cfg
object_cache_file=/var/lib/nagios/objects.cache
precached_object_file=/var/lib/nagios/objects.precache
resource_file=/etc/nagios/resource.cfg
status_file=/var/lib/nagios/status.dat
contactgroups.cfg =>
define contactgroup{
contactgroup_name admins
alias Nagios Admin
members Shashank
}
contacts.cfg =>
define contact{
contact_name Shashank
alias Shashank
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-host-by-email
host_notification_commands notify-service-by-email
email
shashank@test.com
}
hosts.cfg (Only one host shown below)=>
define host{
use generic-host
host_name test2.nagiostest.com
alias Cluster-1
address 192.168.1.55
check_command check-host-alive
max_check_attempts 20
notification_interval 240
notification_period 24x7
notification_options d,u,r
contact_groups admins
}
hostgroups.cfg (Only one cluster shown)=>
define hostgroup{
hostgroup_name Cluster-1
alias Cluster-1
members test1.nagiostest.com,test2.nagiostest.com,test3.nagiostest.com,test4.nagiostest.com,test5.nagiostest .com,testcnt1.nagiostest.com
}
services.cfg =>
define service{
use generic-service
hostgroup_name Cluster-1,Cluster-2,Cluster-3,Cluster-4
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 90
notification_period 24x7
notification_options w,u,c,r
check_command check_ping!100.0,20%!500.0,60%
notifications_enabled 1
}
define service{
use local-service
hostgroup_name Cluster-1,Cluster-2,Cluster-3,Cluster-4
service_description Root Partition
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 90
notification_period 24x7
notification_options w,u,c,r
check_command check_local_disk!20%!10%!/
notifications_enabled 1
}
define service{
use local-service hostgroup_name Cluster-1,Cluster-2,Cluster-3,Cluster-4
service_description /local Partition
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups admins
notification_interval 90
notification_period 24x7
notification_options w,u,c,r
check_command check_local_disk!20%!10%!/local
notifications_enabled 1
}
Commands.cfg (As this is big file, only notification part is mentioned here) =>
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Any idea why alerts are not working and I don’t get correct results for /local disk utilization.
Thanks,
Shashank