限制Nagios报警次数用escalations(1)


Nagios 

图-Nagios

Nagios是非常强大的一款监控工具,尤其是它的告警功能,现在网上实现的形式多种多样如结合移动139邮箱、Fetion、MSN等,但是如果服务器出现故障而未能及时的解决,Nagios就会不断的发送告警信息,实在令人头疼。现在用escalations,如下方法可以解决Nagios的告警次数问题。

系统环境:CentOS 5.2

Nagios版本:3.0.6

Nagios安装路径:/usr/local/nagios

配置文件内容定义:#基本的配置就不再进行注释了。

  1. hosts.cfg  
  2.  
  3. define host{  
  4.  
  5. host_name WWW-Server  
  6.  
  7. alias WWW-Server  
  8.  
  9. address 193.1.16.100  
  10.  
  11. check_command check-host-alive  
  12.  
  13. max_check_attempts 5  
  14.  
  15. check_period 24x7  
  16.  
  17. notification_interval 10  
  18.  
  19. notification_period 24x7  
  20.  
  21. notification_options d,u,r  
  22.  
  23. notifications_enabled 1  
  24.  
  25. contact_groups chengnan  
  26.  
  27. }  
  28.  

  1. Services.cfg  
  2.  
  3. define service{  
  4.  
  5. host_name WWW-Server  
  6.  
  7. service_description Check_HTTP  
  8.  
  9. check_command check_http  
  10.  
  11. max_check_attempts 10  
  12.  
  13. normal_check_interval 3  
  14.  
  15. retry_check_interval 2  
  16.  
  17. check_period 24x7  
  18.  
  19. notification_interval 5  
  20.  
  21. notification_period 24x7  
  22.  
  23. notification_options w,u,c,r  
  24.  
  25. contact_groups admin  
  26.  
  27. }  
  28.  

  1. define service{  
  2.  
  3. host_name WWW-Server  
  4.  
  5. service_description Check_Jetty  
  6.  
  7. check_command check_tcp!8080  
  8.  
  9. max_check_attempts 10  
  10.  
  11. normal_check_interval 3  
  12.  
  13. retry_check_interval 2  
  14.  
  15. check_period 24x7  
  16.  
  17. notification_interval 5  
  18.  
  19. notification_period 24x7  
  20.  
  21. notification_options w,u,c,r  
  22.  
  23. contact_groups admin  
  24.  
  25. }  
  26.  

  1. Contacts.cfg  
  2.  
  3. define contact{  
  4.  
  5. contact_name chengnan  
  6.  
  7. alias chengnan  
  8.  
  9. service_notification_period 24x7  
  10.  
  11. host_notification_period 24x7  
  12.  
  13. service_notification_options w,u,c,r  
  14.  
  15. host_notification_options d,u,r  
  16.  
  17. service_notification_commands notify-service-by-email  
  18.  
  19. host_notification_commands notify-host-by-email  
  20.  
  21. email chengnan@139.com //手机邮箱  
  22.  
  23. }  
  24.  

  1. define contactgroup{  
  2.  
  3. contactgroup_name chengnan  
  4.  
  5. alias Nagios Administrators  
  6.  
  7. members chengnan  
  8.  
  9. }  
  10.  


相关内容