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

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

Nagios遠程監控安裝與配置詳解圖文第3/3頁

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

2、增加新的配置文件
先創建簡單的配置文件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小時監控。
第二個手動創建的配置文件是 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個聯系人,如果有更多聯系人的話,照這個格式在后面追加即可。服務通知選項(service_notification_options)與主機通知選項(host_notification_options)的幾個選項在這里說明一下:w-warning , u-unknown,c-critical,r-recovery;d-down,u-unreachable,注意一下,主機報警和服務報警有些差異。
緊接著的第三個手動創建的配置文件是contactgroups.cfg文件,這個文件是依照上一個文件contacts.cfg來的,contactgroups文件相對簡單一些,其格式如下:
define contactgroup {    contactgroup_name  sagroup //不要用空格    alias        system administrator group    members       sa,sery //本例有2個成員}
多個成員之間用逗號做分界符,如果有更多的聯系組,就依相同的格式在文件中追加余下的組。
關鍵的角色終于登場,這就是配置文件hosts.cfg。下面是我定義的兩個主機的基本樣式:
<small id="cxvok"><tbody id="cxvok"></tbody></small>

<small id="cxvok"></small>
#define monitor host################################################################## Wangjing IDC servers                     ##################################################################define host {    host_name         nagios-server    alias           nagios server    address          61.x..x.49    contact_groups       sagroup //多個聯系組用逗號分隔,
數據來源于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機就發報警通知 max_check_attempts 5 notification_interval 10 notification_period 24x7 notification_options d,u,r }
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 普兰店市| 南京市| 江源县| 阿瓦提县| 池州市| 舞阳县| 彭州市| 高州市| 阜阳市| 南陵县| 武城县| 普格县| 永顺县| 仁化县| 屯留县| 醴陵市| 安义县| 金山区| 黄浦区| 定远县| 宁海县| 平阳县| 大足县| 河西区| 东乡| 宜都市| 宜宾县| 曲靖市| 油尖旺区| 清镇市| 赫章县| 德惠市| 长子县| 安泽县| 中方县| 芮城县| 博客| 莱阳市| 合阳县| 辉南县| 内乡县|
<track id="cxvok"><tbody id="cxvok"></tbody></track>
      1. <td id="cxvok"></td>