Nagios不發(fā)郵件通知的解決
Nagios不發(fā)郵件通知的解決
***個(gè)想到的是warning報(bào)警發(fā)了郵件,而CRITICAL就報(bào)警不發(fā)郵件通知了,又看了一下nagios的日志,我service的狀態(tài)變化是出在周六,也就是從warning轉(zhuǎn)變成critical就不發(fā)郵件了,問(wèn)題可能出在服務(wù)報(bào)警通知那部分,于是先看了一下我定義的所有服務(wù)和主機(jī)的模板文件,內(nèi)容如下:
- # vi genericdef.cfg
- define host{
- name generic-host
- check_period 24x7
- notifications_enabled 1
- event_handler_enabled 1
- process_perf_data 1
- retain_nonstatus_information 0
- contact_groups admins
- notification_interval 60
- notification_period 24x7
- notification_options d,u,r
- stalking_options o,d,u
- register 0
- }
- define service{
- name generic-service
- active_checks_enabled 1
- passive_checks_enabled 1
- notifications_enabled 1
- event_handler_enabled 1
- check_period 24x7
- max_check_attempts 3
- normal_check_interval 10
- retry_check_interval 2
- contact_groups admins
- notification_options w,u,c,r
- notification_interval 60
- notification_period 24x7
- register 0
- }
從上面service定義來(lái)看,通知選項(xiàng)已經(jīng)加入了c(CRITICAL)這個(gè)參數(shù)了,看了問(wèn)題不是出在這里。
第二個(gè)我想到的地方就是contract的配置文件,打開(kāi)看了一下
- define contact{
- contact_name nagios-msn-admin
- alias Nagios msn Admin
- email harvey_liu@wenzizone.cn
- host_notification_commands notify-host-by-msn
- host_notification_options d,u
- host_notification_period 24x7
- service_notification_period 24x7
- service_notification_options w,u,r,c //這個(gè)位置之前是沒(méi)有c
- service_notification_commands notify-service-by-msn
- }
- define contact{
- contact_name nagios-mail-admin
- alias Nagios mail Admin
- email hanzhao.liu@wenzizone.cn
- host_notification_commands notify-host-by-email
- host_notification_options d,u
- host_notification_period 24x7
- service_notification_period 24x7
- service_notification_options w,u,r,c //這個(gè)位置之前沒(méi)有c
- service_notification_commands notify-service-by-email
- }
在上面的第9和21行的位置加上c之后,然后重新reload一下nagios,如果沒(méi)有報(bào)錯(cuò),說(shuō)明配置更新完畢,很快蚊子又可以收到報(bào)警的郵件了。Nagios調(diào)整是一個(gè)細(xì)致的活,大家解決了Nagios不發(fā)郵件的情況了嗎?
【編輯推薦】