Nagios is a very powerful monitoring tool, especially its alarm function. It now supports a variety of forms on the Internet, such as mobile phone 139 mailbox, Fetion, and MSN, however, if the server fails to be resolved in a timely manner, Nagios will continuously send alarm messages, which is a headache. The following method can be used to solve the issue of the number of Nagios alarms.
System Environment: CentOS 5.2
Nagios version: 3.0.6
Nagios installation path:/usr/local/nagios
Definition of configuration file content: # basic configuration will not be commented out.
Hosts. cfg
Define host {
Host_name WWW-Server
Alias WWW-Server
Address 193.1.16.100
Check_command check-host-alive
Max_check_attempts 5
Check_period 24x7
Icationication_interval 10
Icationication_period 24x7
Notification_options d, u, r
Notifications_enabled 1
Contact_groups chengnan
}
Services. cfg
Define service {
Host_name WWW-Server
Service_description Check_HTTP
Check_command check_http
Max_check_attempts 10
Normal_check_interval 3
Retry_check_interval 2
Check_period 24x7
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Contact_groups admin
}
Define service {
Host_name WWW-Server
Service_description Check_Jetty
Check_command check_tcp! 8080
Max_check_attempts 10
Normal_check_interval 3
Retry_check_interval 2
Check_period 24x7
Icationication_interval 5
Icationication_period 24x7
Notification_options w, u, c, r
Contact_groups admin
}
Contacts. cfg
Define contact {
Contact_name chengnan
Alias chengnan
Service_icationication_period 24x7
Host_icationication_period 24x7
Service_icationication_options w, u, c, r
Host_icationication_options d, u, r
Service_icationication_commands notify-service-by-email
Host_icationication_commands notify-host-by-email
Email chengnan@139.com // email
}
Define contactgroup {
Contactgroup_name chengnan
Alias Nagios Administrators
Mem