nagios报警的问题

最近我写了关于naigos监控的安装与配置的技术文档,公司运维按照我的文档部署naigos,发现不能发送报警邮件,经过我的检查,发现问题如下:

1、hosts里的配置

   
   
   
   
  1. [root@nagios ~]# cat /etc/hosts  

  2. # Do not remove the following line, or various programs  

  3. # that require network functionality will fail.  

  4. 127.0.0.1   localhost.localdomain localhost  

  5. ::1     localhost6.localdomain6 localhost6  

  6. 172.16.4.3  nagios.com  nagios ##一定要有本机的ip对应  

2 、hostname与/etc/sysconfig/network里的hostname一致,并与hosts里的一致

3、去nagios的web里,选择报警的服务(如果httpd),

点击http旁边的这个摁钮,如果你看到notification状态为disabled       那么你可以选择右侧的,然后选择commit 。出现下面对话框

下面查看一下nagios.log里的日志
   
   
   
   
  1. [root@nagios var]# tail -f nagios.log  

  2. [1326419317] Auto-save of retention data completed successfully.  

  3. [1326422917] Auto-save of retention data completed successfully.  

  4. [1326424408] EXTERNAL COMMAND: ENABLE_SVC_NOTIFICATIONS;henan-cunchu;HTTP  

  5. [1326424434] Caught SIGTERM, shutting down...  

  6. [1326424434] Successfully shutdown... (PID=6823)  

  7. [1326424434] Nagios 3.3.1 starting... (PID=25398)  

  8. [1326424434] Local time is Fri Jan 13 11:13:54 CST 2012  

  9. [1326424434] LOG VERSION: 2.0  

  10. [1326424434] Finished daemonizing... (New PID=25399)  

  11. [1326424464] SERVICE NOTIFICATION: nagiosadmin;henan-cunchu;HTTP;CRITICAL;notify-service-by-email;?.?杩..  

如果内容有service notification这样的话,就代表nagios发送了邮件报警,下面是我接收到的报警邮件


就代表你启动了这个http服务的报警了,这一步完成之后等待10s左右,刷新页面就能看看notification的状态变为enabled,而且能收到报警,其他的服务也类似这样操作。



你可能感兴趣的:(nagios)