Nagios不发邮件通知的解决
创始人
2024-07-23 22:40:58
0

  Nagios不发邮件通知的解决

  ***个想到的是warning报警发了邮件,而CRITICAL就报警不发邮件通知了,又看了一下nagios的日志,我service的状态变化是出在周六,也就是从warning转变成critical就不发邮件了,问题可能出在服务报警通知那部分,于是先看了一下我定义的所有服务和主机的模板文件,内容如下:

  1. # vi genericdef.cfg  
  2.  
  3. define host{  
  4.  
  5. name generic-host  
  6.  
  7. check_period 24x7  
  8.  
  9. notifications_enabled 1  
  10.  
  11. event_handler_enabled 1  
  12.  
  13. process_perf_data 1  
  14.  
  15. retain_nonstatus_information 0  
  16.  
  17. contact_groups admins  
  18.  
  19. notification_interval 60  
  20.  
  21. notification_period 24x7  
  22.  
  23. notification_options d,u,r  
  24.  
  25. stalking_options o,d,u  
  26.  
  27. register 0  
  28.  
  29. }  
  30.  
  31. define service{  
  32.  
  33. name generic-service  
  34.  
  35. active_checks_enabled 1  
  36.  
  37. passive_checks_enabled 1  
  38.  
  39. notifications_enabled 1  
  40.  
  41. event_handler_enabled 1  
  42.  
  43. check_period 24x7  
  44.  
  45. max_check_attempts 3  
  46.  
  47. normal_check_interval 10  
  48.  
  49. retry_check_interval 2  
  50.  
  51. contact_groups admins  
  52.  
  53. notification_options w,u,c,r  
  54.  
  55. notification_interval 60  
  56.  
  57. notification_period 24x7  
  58.  
  59. register 0  
  60.  
  61. }  
  62.  

  从上面service定义来看,通知选项已经加入了c(CRITICAL)这个参数了,看了问题不是出在这里。

  第二个我想到的地方就是contract的配置文件,打开看了一下

  1. define contact{  
  2.  
  3. contact_name nagios-msn-admin  
  4.  
  5. alias Nagios msn Admin  
  6.  
  7. email harvey_liu@wenzizone.cn  
  8.  
  9. host_notification_commands notify-host-by-msn  
  10.  
  11. host_notification_options d,u  
  12.  
  13. host_notification_period 24x7  
  14.  
  15. service_notification_period 24x7  
  16.  
  17. service_notification_options w,u,r,c //这个位置之前是没有c  
  18.  
  19. service_notification_commands notify-service-by-msn  
  20.  
  21. }  
  22.  
  23. define contact{  
  24.  
  25. contact_name nagios-mail-admin  
  26.  
  27. alias Nagios mail Admin  
  28.  
  29. email hanzhao.liu@wenzizone.cn  
  30.  
  31. host_notification_commands notify-host-by-email  
  32.  
  33. host_notification_options d,u  
  34.  
  35. host_notification_period 24x7  
  36.  
  37. service_notification_period 24x7  
  38.  
  39. service_notification_options w,u,r,c //这个位置之前没有c  
  40.  
  41. service_notification_commands notify-service-by-email  
  42.  
  43. }  
  44.  

  在上面的第9和21行的位置加上c之后,然后重新reload一下nagios,如果没有报错,说明配置更新完毕,很快蚊子又可以收到报警的邮件了。Nagios调整是一个细致的活,大家解决了Nagios不发邮件的情况了吗?

【编辑推荐】

Nagios飞信linux短信报警脚本配置

Nagios安装记录

如何用Nagios监控远程系统

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...