网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Customcontact

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

10年积累的成都网站设计、网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先做网站设计后付款的网站建设流程,更有襄州免费网站建设让你可以放心的选择与我们合作。

# '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


文章题目:Customcontact
网站网址:http://bjjierui.cn/article/pcopdc.html

其他资讯