中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Custom contact

發布時間:2020-07-12 14:26:33 來源:網絡 閱讀:367 作者:卍偽裝卍 欄目:移動開發

Modify the command file:
# vi /etc/nagios/objects/commands.cfg

# 'notify-host-by-email' command definition
define command{
    command_name      notify-host-by-email
    command_line      /usr/bin/printf "\nHost: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time\n" | /bin/mail -s "$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HO
STSTATE$" $CONTACTEMAIL$
    }
# 'notify-service-by-email' command definition
define command{
    command_name      notify-service-by-email
    command_line      /usr/bin/printf "\nHost: $HOSTADDRESS$\nInfo: $SERVICEOUTPUT$\n\nDate/Time\n" | /bin/mail -s "$NOTIFICATIONTYPE$ Service Alert: $SERVICEDES
C$ is $SERVICESTATE$" $CONTACTEMAIL$
    }

Modify the template file:
# vi /etc/nagios/objects/templates.cfg

define contact{
    name                           generic-contact         ;The name of this contact template
    service_notification_period    24x7
    host_notification_period       24x7
    service_notification_options   w,u,c,r,f,s
    host_notification_options      d,u,r,f,s
    service_notification_commands  notify-service-by-email ;send service notifications via email
    host_notification_commands     notify-host-by-email    ;send host notifications via email
    register                       0                       ;DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
    }


Modify the contact file:
# vi /etc/nagios/objects/contacts.cfg

define contact{
    contact_name                   test1              ; Short name of user
    use                            generic-contact
    alias                          network Admin      ; Full name of user
    host_notifications_enabled     1
    service_notifications_enabled  1
    host_notification_period       24x7
    service_notification_period    24x7
    host_notification_options      d,u,r
    service_notification_options   w,u,c,r
    host_notification_commands     notify-host-by-email
    service_notification_commands  notify-service-by-email
    email                          test@163.com
    }
define contact{
    contact_name                   test2              ; Short name of user
    use                            generic-contact
    alias                          network Admin      ; Full name of user
    host_notifications_enabled     1
    service_notifications_enabled  1
    email                          test2@localhost.localdomain
    }
define contact{
    contact_name                   test3              ; Short name of user
    use                            generic-contact
    alias                          system Admin       ; Full name of user
    host_notifications_enabled     1
    service_notifications_enabled  1
    host_notification_period       24x7
    service_notification_period    24x7
    host_notification_options      d,u,r
    service_notification_options   w,u,c,r
    host_notification_commands     notify-host-by-email
    service_notification_commands  notify-service-by-email
    email                          464165559@qq.com
    }
define contactgroup{
    contactgroup_name    Network
    alias                Network Administrators
    members              test1,test2
    }
define contactgroup{
    contactgroup_name    System
    alias                System Administrators
    members              test3
    }


Modify the hosts file to be monitored:
# vi /etc/nagios/Linuxhosts/localhost.cfg

define service{
    use                       local-service,srv-pnp  ; Name of service template to use
    host_name                 Monitor
    service_description       Root Partition
    check_command             check_local_disk!60%!90%!/dev/sda2
    contacts                  test3
    contact_groups            Network
    }


Grammar Checker&&Restart:
# /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
# service nagios restart




向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

肇庆市| 桑日县| 佛教| 汪清县| 汝州市| 米易县| 旬阳县| 临沭县| 犍为县| 荥阳市| 高邮市| 射洪县| 米林县| 新乡市| 乌恰县| 益阳市| 甘南县| 庆云县| 新民市| 江油市| 合肥市| 秦皇岛市| 花莲市| 天水市| 白城市| 基隆市| 平和县| 尖扎县| 眉山市| 巍山| 赫章县| 邹平县| 清水河县| 绥化市| 新化县| 临海市| 乳源| 新晃| 正镶白旗| 竹溪县| 屏东县|