nagios email notification problem
Hi all,
I am using nagios 4.2 to monitor our local servers. But we face some problem on email notification function. if i set the host 'max_check_attempts' > 1, nagios will never send email notification to contact groups. If set the 'max_check_attempts' = 1, everything is normal. Email notification will send immediately if any service down. However, we don't want too many false alarm and want to set the max_check_attempts to 2. Can anyone help me? I am using amazon ec2 linux instance. Thanks. Below is the config of nagios.
host1.cfg
define hostgroup{
hostgroup_name hostgroup1
alias hostgroup1
}
define host {
use linux-server
host_name host1
hostgroups hostgroup1
alias host1
address xx.xx.xx.xx
register 1
}
define service{
host_name host1
service_description PING
check_command check_ping!150.0,20%!500.0,60%
max_check_attempts 2
check_interval 2
retry_interval 2
check_period 24x7
check_freshness 1
contact_groups admins
notification_interval 2
notification_period 24x7
notifications_enabled 1
register 1
}
define service{
use generic-service
host_name host1
service_description Server HTTP URL available check
check_command check_http! -H xxxxxxxxxxxx -u xxxxxxxxxxxxxx -w 8
max_check_attempts 2
check_interval 2
check_period 24x7
}
contacts.cfg
define contact{
contact_name nagiosadmin
use generic-contact
alias Nagios Admin
email xxxxxxxxxxxxxxxx
service_notification_commands notify-service-by-email
host_notification_commands notify-service-by-email
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
templates.cfg
define contact{
name generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0
}
Best Regards,
Kelvin
Last edited by dexfcoss; 08-11-2016 at 11:44 PM.
|