jojo's blog--快樂憂傷都與你同在
          為夢(mèng)想而來,為自由而生。 性情若水,風(fēng)起水興,風(fēng)息水止,故時(shí)而激蕩,時(shí)又清平……
          posts - 11,  comments - 30,  trackbacks - 0
          Nagios 監(jiān)控的主要內(nèi)容,也是我們最為關(guān)注的內(nèi)容是對(duì)服務(wù)的監(jiān)控。Nagios中對(duì)服務(wù)的定義方式與上文中定義主機(jī)的方式一致,參數(shù)也大體相同。下面列出定義servce的參數(shù),其含義大多在上文中介紹過了,此處及就不再介紹了。

          define service {

          host_name host_name

          service_description service_description

          servicegroups servicegroup_names

          is_volatile [0/1]  #是否啟用“volatile”模式。這個(gè)模式的含義是說名這個(gè)服務(wù)是不穩(wěn)定的,或者說是危險(xiǎn)的。只要其狀態(tài)改變了,就不會(huì)再自己被恢復(fù)回來。這個(gè)參數(shù)很少使用,等到使用的時(shí)候我們?cè)賮砑?xì)說。

          check_command command_name

          max_check_attempts #
          normal_check_interval #

          retry_check_interval #

          active_checks_enabled [0/1]

          passive_checks_enabled [0/1]

          check_period timeperiod_name

          parallelize_check [0/1]

          obsess_over_service [0/1]

          check_freshness [0/1]

          freshness_threshold #

          event_handler command_name

          event_handler_enabled [0/1]

          low_flap_threshold #

          high_flap_threshold #

          flap_detection_enabled [0/1]

          process_perf_data [0/1]

          retain_status_information [0/1]

          retain_nonstatus_information [0/1]

          notification_interval #

          notification_period timeperiod_name n

          otification_options [w,u,c,r,f]

          notifications_enabled [0/1]

          contact_groups contact_groups

          stalking_options [o,w,u,c]

          }


          ok,還是讓我們來舉例說明一下吧。

          1、隨時(shí)監(jiān)控Web.TEST主機(jī)上的HTTP服務(wù)(80端口),發(fā)生兩次不能訪問及認(rèn)定是發(fā)生故障,故障累計(jì)3次告警,聯(lián)系人組是mygroup。告警之后每?jī)煞昼娫龠M(jìn)行一次檢查,如果10分鐘之后仍然沒有恢復(fù),再發(fā)送一次告警。

          define service {

          host_name Web.TEST

          service_description check_tcp 80

          check_period 24x7

          max_check_attempts 2

          normal_check_interval 3

          retry_check_interval 2

          contact_groups mygroup

          notification_interval 10

          notification_period 24x7

          notification_options w,u,c,r

          check_command check_tcp!80

          }


          如果要檢測(cè)其他服務(wù),則將代碼中藍(lán)色的兩行修改即可。例如,要檢查默認(rèn)的ssh服務(wù)是否開啟:

          define service {

          host_name Web.TEST

          service_description check_ssh

          check_period 24x7

          ……

          check_command check_ssh

          }


          在測(cè)試服務(wù)的時(shí)候,要充分發(fā)揮插件的功能,如何安裝和使用插件,請(qǐng)看這篇文章
          posted on 2009-05-13 13:49 Blog of JoJo 閱讀(70) 評(píng)論(0)  編輯  收藏 所屬分類: 每日一記

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          相冊(cè)

          收藏夾

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 德州市| 宜兰市| 五家渠市| 益阳市| 西乡县| 札达县| 德阳市| 株洲市| 海兴县| 玉溪市| 杭锦旗| 鄱阳县| 南溪县| 尖扎县| 繁昌县| 封开县| 金平| 岳西县| 石阡县| 临沧市| 大理市| 正宁县| 宜川县| 巴青县| 花垣县| 化州市| 新蔡县| 调兵山市| 济源市| 南通市| 拜泉县| 锡林郭勒盟| 万载县| 航空| 桂平市| 浑源县| 曲松县| 葵青区| 珠海市| 大新县| 新民市|