1、hosts里的配置
- [root@nagios ~]# cat /etc/hosts
- # Do not remove the following line, or various programs
- # that require network functionality will fail.
- 127.0.0.1 localhost.localdomain localhost
- ::1 localhost6.localdomain6 localhost6
- 172.16.4.3 nagios.com nagios ##一定要有本机的ip对应
3、去nagios的web里,选择报警的服务(如果httpd)

点击http旁边的这个摁钮,如果你看到notification状态为disabled

那么你可以选择右侧的启用该服务的通知,然后选择commit 。

出现下面对话框

下面查看一下nagios.log里的日志
- [root@nagios var]# tail -f nagios.log
- [1326419317] Auto-save of retention data completed successfully.
- [1326422917] Auto-save of retention data completed successfully.
- [1326424408] EXTERNAL COMMAND: ENABLE_SVC_NOTIFICATIONS;henan-cunchu;HTTP
- [1326424434] Caught SIGTERM, shutting down...
- [1326424434] Successfully shutdown... (PID=6823)
- [1326424434] Nagios 3.3.1 starting... (PID=25398)
- [1326424434] Local time is Fri Jan 13 11:13:54 CST 2012
- [1326424434] LOG VERSION: 2.0
- [1326424434] Finished daemonizing... (New PID=25399)
- [1326424464] SERVICE NOTIFICATION: nagiosadmin;henan-cunchu;HTTP;CRITICAL;notify-service-by-email;

就代表你启动了这个http服务的报警了,这一步完成之后等待10s左右,刷新页面就能看看notification的状态变为enabled,而且能收到报警,其他的服务也类似这样操作。
----------------------------------------------------------------------------------------------------------------
原博客地址: http://dl528888.blog.51cto.com/2382721/763079
----------------------------------------------------------------------------------------------------------------