成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

escalations限制Nagios報警次數

運維 系統運維
escalations限制Nagios報警次數:Nagios是一個監控系統運行狀態和網絡信息的監控系統。Nagios能監控所指定的本地或遠程主機以及服務,同時提供異常通知功能等。這篇文章主要講的是escalations限制Nagios報警次數

  escalations限制Nagios報警次數

  Nagios是非常強大的一款監控工具,尤其是它的告警功能,現在網上實現的形式多種多樣如結合移動139郵箱、Fetion、MSN等,但是如果服務器出現故障而未能及時的解決,Nagios就會不斷的發送告警信息,實在令人頭疼?,F在用如下方法可以解決Nagios的告警次數問題。

  系統環境:

  CentOS 5.2

  Nagios版本:3.0.6

  Nagios安裝路徑:/usr/local/nagios

  配置文件內容定義:

  1.   #基本的配置就不再進行注釋了。  
  2.  
  3.   hosts.cfg  
  4.  
  5.   define host{  
  6.  
  7.   host_name WWW-Server  
  8.  
  9.   alias WWW-Server  
  10.  
  11.   address 193.1.16.100  
  12.  
  13.   check_command check-host-alive  
  14.  
  15.   max_check_attempts 5  
  16.  
  17.   check_period 24×7  
  18.  
  19.   notification_interval 10  
  20.  
  21.   notification_period 24×7  
  22.  
  23.   notification_options d,u,r  
  24.  
  25.   notifications_enabled 1  
  26.  
  27.   contact_groups chengnan  
  28.  
  29.   }  
  30.  
  31.   Services.cfg  
  32.  
  33.   define service{  
  34.  
  35.   host_name WWW-Server  
  36.  
  37.   service_description Check_HTTP  
  38.  
  39.   check_command check_http  
  40.  
  41.   max_check_attempts 10  
  42.  
  43.   normal_check_interval 3  
  44.  
  45.   retry_check_interval 2  
  46.  
  47.   check_period 24×7  
  48.  
  49.   notification_interval 5  
  50.  
  51.   notification_period 24×7  
  52.  
  53.   notification_options w,u,c,r  
  54.  
  55.   contact_groups admin  
  56.  
  57.   }  
  58.  
  59.   define service{  
  60.  
  61.   host_name WWW-Server  
  62.  
  63.   service_description Check_Jetty  
  64.  
  65.   check_command check_tcp!8080  
  66.  
  67.   max_check_attempts 10  
  68.  
  69.   normal_check_interval 3  
  70.  
  71.   retry_check_interval 2  
  72.  
  73.   check_period 24×7  
  74.  
  75.   notification_interval 5  
  76.  
  77.   notification_period 24×7  
  78.  
  79.   notification_options w,u,c,r  
  80.  
  81.   contact_groups admin  
  82.  
  83.   }  
  84.  
  85.   Contacts.cfg  
  86.  
  87.   define contact{  
  88.  
  89.   contact_name chengnan  
  90.  
  91.   alias chengnan  
  92.  
  93.   service_notification_period 24×7  
  94.  
  95.   host_notification_period 24×7  
  96.  
  97.   service_notification_options w,u,c,r  
  98.  
  99.   host_notification_options d,u,r  
  100.  
  101.   service_notification_commands notify-service-by-email  
  102.  
  103.   host_notification_commands notify-host-by-email  
  104.  
  105.   email chengnan@139.com //手機郵箱  
  106.  
  107.   }define contactgroup{  
  108.  
  109.   contactgroup_name chengnan  
  110.  
  111.   alias Nagios Administrators  
  112.  
  113.   members chengnan  
  114.  
  115.   }  
  116.  

  除此之外再定義一個聯系人

  1.   define contact{  
  2.  
  3.   contact_name chengnan_cor  
  4.  
  5.   alias chengnan_cor  
  6.  
  7.   service_notification_period 24×7  
  8.  
  9.   host_notification_period 24×7  
  10.  
  11.   service_notification_options w,u,c,r  
  12.  
  13.   host_notification_options d,u,r  
  14.  
  15.   service_notification_commands notify-service-by-email  
  16.  
  17.   host_notification_commands notify-host-by-email  
  18.  
  19.   email chengnan@company.com //公司郵箱  
  20.  
  21.   }  
  22.  
  23.   define contactgroup{  
  24.  
  25.   contactgroup_name sysadmin  
  26.  
  27.   alias sysadmin  
  28.  
  29.   members chengnan_cor  
  30.  
  31.   }  
  32.  

  然后創建一個配置文件:

  1.   vi escalations.cfg  
  2.  

  escalations有自動調整;不斷增加; 逐步上升等意思,本身配置文件的功能是當服務在某一告警次數前沒有恢復,告警頻率周期將會縮短,同時將告警信息發送至指定聯系人。

  其內容為:

  1.   define hostescalation{  
  2.  
  3.   host_name WWW-Server //被監控主機名稱,與Hosts.cfg中一致  
  4.  
  5.   first_notification 4 // 第n條信息起,改變頻率間隔  
  6.  
  7.   last_notification 0 // 第n條信息起,恢復頻率間隔  
  8.  
  9.   notification_interval 30 // 通知間隔(分)  
  10.  
  11.   contact_groups sysadmin  
  12.  
  13.   }  
  14.  

  說明:從第4條告警信息起至服務器恢復前,告警信息發送至sysadmin組下的聯系人,告警間隔為30分鐘1條信息。

  1.   define serviceescalation{  
  2.  
  3.   host_name WWW-Server //被監控主機名稱,與Hosts.cfg中一致  
  4.  
  5.   service_description Check_HTTP,Check_Jetty //被監控服務名稱,與Services.cfg中一致  
  6.  
  7.   first_notification 4  
  8.  
  9.   last_notification 0  
  10.  
  11.   notification_interval 30  
  12.  
  13.   contact_groups sysadmin  
  14.  
  15.   }  
  16.  

  保存

  修改nagios.cfg

  vi nagios.cfg

  添加:

  1.   cfg_file=/usr/local/nagios/etc/objects/escalations.cfg  
  2.  

  檢查nagios配置文件是否正確

  1.   /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg  
  2.  

  重新啟動nagios服務:

  1.   service nagios restart  
  2.  

  測試:

  服務器啟動后停掉被監控測試機的相應服務,確認告警信息是否按照設置發送至不同信箱

  結束語

  escalations這個功能官方給的定義是notification的擴充,使notification變得更加靈活,方便。

  文中我使用的方法算是耍了個小聰明,將第四條告警信息后的所有信息全部發送至我公司郵箱直至服務器恢復(recovery的信息還是會發送至手機的),從而實現限制告警信息發送至手機的條數。

【編輯推薦】

Nagios報錯notify-by-email解決

Nagios配置文件的結構

配置Nagios監控Oracle服務器

責任編輯:zhaolei 來源: nagiostutorial
相關推薦

2011-03-21 15:44:52

escalationsNagios

2011-03-25 14:56:43

Nagiosescalations

2011-03-23 13:32:14

Nagios飛信

2011-03-25 13:10:08

2011-03-24 08:56:21

Nagios郵件

2011-03-23 09:07:49

Nagios飛信

2011-03-22 16:31:27

Nagios

2011-03-23 09:07:50

Nagios短信

2011-03-23 12:55:51

NagiosMSN飛信

2011-03-24 13:00:31

Nagios飛信

2011-03-24 10:08:42

Nagios飛信Linux

2011-04-06 14:24:18

2018-12-04 09:02:14

正則表達式回溯WEB安全

2025-03-05 07:58:30

2011-03-31 16:05:18

Redhat配置nagios

2011-08-22 12:25:02

nagios

2011-03-21 15:35:01

Nagiosnagios-plug安裝

2010-05-31 09:06:12

Nagios飛信

2015-01-05 09:59:42

2011-03-28 15:37:53

nagios作用
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 日韩精品一二三 | 欧美天堂在线 | 国产亚洲二区 | 黄色一级大片在线免费看产 | 国产精品视频久久久久久 | av三级| 免费在线观看成年人视频 | 在线日韩在线 | 久久免费国产视频 | 国产精品毛片一区二区三区 | a国产视频| 国久久| 亚洲人成在线播放 | 日韩一区二区在线播放 | 黄网站在线观看 | 中文字幕精品一区 | 久久久免费观看视频 | 久国产视频 | 欧美专区在线 | 成人免费区一区二区三区 | 欧美日韩在线观看视频 | h肉视频| 人人澡人人射 | 成人激情视频 | 国内自拍偷拍 | 午夜精品一区二区三区在线视频 | www.精品国产 | 日本精品久久久久久久 | 日韩一区二区三区四区五区 | 成人在线不卡 | 日本久久网 | 一级免费在线视频 | 国产一区在线视频 | 岛国午夜| 日韩欧美二区 | 国产精品国产三级国产aⅴ浪潮 | 中文字幕免费 | 国产电影一区二区在线观看 | 毛片区| 日韩欧美亚洲 | 亚洲精品自在在线观看 |