jojo's blog--快樂(lè)憂傷都與你同在
          為夢(mèng)想而來(lái),為自由而生。 性情若水,風(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ù),其含義大多在上文中介紹過(guò)了,此處及就不再介紹了。

          define service {

          host_name host_name

          service_description service_description

          servicegroups servicegroup_names

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

          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,還是讓我們來(lái)舉例說(shuō)明一下吧。

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

          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)  編輯  收藏 所屬分類(lèi): 每日一記

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

          常用鏈接

          留言簿(6)

          隨筆檔案

          文章分類(lèi)

          文章檔案

          新聞分類(lèi)

          新聞檔案

          相冊(cè)

          收藏夾

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 东安县| 肇州县| 玉溪市| 康定县| 泾阳县| 乌什县| 舞钢市| 滨州市| 准格尔旗| 孝昌县| 凉城县| 惠水县| 冀州市| 洪湖市| 稻城县| 宜君县| 浦北县| 仪陇县| 府谷县| 宜良县| 通山县| 杭锦旗| 农安县| 军事| 叙永县| 江门市| 苏尼特左旗| 简阳市| 湖南省| 阳信县| 那曲县| 临高县| 法库县| 五华县| 建德市| 开江县| 棋牌| 延寿县| 嫩江县| 宜阳县| 资阳市|