国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 幫助中心 > 正文

Nagios遠程監(jiān)控安裝與配置詳解圖文第3/3頁

2024-07-09 22:40:50
字體:
來源:轉載
供稿:網友

2、增加新的配置文件
先創(chuàng)建簡單的配置文件timeperiods.cfg,其內容如下:
define timeperiod{    timeperiod_name 24x7    alias      24 Hours A Day, 7 Days A Week    sunday     00:00-24:00    monday     00:00-24:00    tuesday     00:00-24:00    wednesday    00:00-24:00    thursday    00:00-24:00    friday     00:00-24:00    saturday    00:00-24:00    }
這個文件的定義明晰易懂,不多做說明。另建議7X24小時監(jiān)控。
第二個手動創(chuàng)建的配置文件是 contacts.cfg,其格式如下:
define contact {    contact_name     sa  //不要有空格    alias        system administrator    service_notification_period  24x7    host_notification_period    24x7    service_notification_options  w,u,c,r    host_notification_options    d,u,r    service_notification_commands service-notify-by-sms,service-notify-by-email //這個命令讀配置文件miscommands.cfg    host_notification_commands   host-notify-by-email,host-notify-by-sms   //這個命令讀配置文件miscommands.cfg    email             sery@163.com    pager             13333333333 //手機號,收報警短信    }   //不要把這個符號寫掉了define contact {    contact_name     sery    alias        system administrator    service_notification_period  24x7    host_notification_period    24x7    service_notification_options  w,u,c,r    host_notification_options    d,u,r    service_notification_commands service-notify-by-sms,service-notify-by-email    host_notification_commands   host-notify-by-email,host-notify-by-sms    email             sery@sohu.com    pager             13312345678    }
上面的文件定義了2個聯(lián)系人,如果有更多聯(lián)系人的話,照這個格式在后面追加即可。服務通知選項(service_notification_options)與主機通知選項(host_notification_options)的幾個選項在這里說明一下:w-warning , u-unknown,c-critical,r-recovery;d-down,u-unreachable,注意一下,主機報警和服務報警有些差異。
緊接著的第三個手動創(chuàng)建的配置文件是contactgroups.cfg文件,這個文件是依照上一個文件contacts.cfg來的,contactgroups文件相對簡單一些,其格式如下:
define contactgroup {    contactgroup_name  sagroup //不要用空格    alias        system administrator group    members       sa,sery //本例有2個成員}
多個成員之間用逗號做分界符,如果有更多的聯(lián)系組,就依相同的格式在文件中追加余下的組。
關鍵的角色終于登場,這就是配置文件hosts.cfg。下面是我定義的兩個主機的基本樣式:
  • <noscript id="9gocr"></noscript>

        <noscript id="9gocr"></noscript>
        <style id="9gocr"></style>
        <small id="9gocr"></small>
              #define monitor host################################################################## Wangjing IDC servers                     ##################################################################define host {    host_name         nagios-server    alias           nagios server    address          61.x..x.49    contact_groups       sagroup //多個聯(lián)系組用逗號分隔,
              數據來源于contactgroups.cfg check_command check-host-alive max_check_attempts 5 notification_interval 10 //值可調,大小什么值合適需自己測定 notification_period 24x7 notification_options d,u,r }define host { host_name 24-25 alias server 24-25 address 202.X.24.25 contact_groups sagroup check_command check-host-alive //down機就發(fā)報警通知 max_check_attempts 5 notification_interval 10 notification_period 24x7 notification_options d,u,r }
              發(fā)表評論 共有條評論
              用戶名: 密碼:
              驗證碼: 匿名發(fā)表
              主站蜘蛛池模板: 阿巴嘎旗| 陆河县| 隆德县| 贵阳市| 邢台市| 东明县| 郯城县| 大城县| 贵阳市| 闽侯县| 石林| 北票市| 定南县| 监利县| 民乐县| 伊宁市| 黔西县| 沅江市| 祁门县| 多伦县| 蒲城县| 文登市| 班戈县| 尉氏县| 舟山市| 潞西市| 襄垣县| 阿合奇县| 邹平县| 江山市| 栾川县| 开化县| 北京市| 普宁市| 涟源市| 侯马市| 库伦旗| 柞水县| 射阳县| 聊城市| 仙居县|
              <td id="9gocr"></td>