DefineAServiceGroup

View has been monitoring Cisco machine:

网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、小程序设计、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了江口免费建站欢迎大家使用!

# cd /etc/nagios/Cisco/

HYQH-BJ.cfg  HYQH-SH.cfg  HYQH-ZQ.cfg

View existing configuration:

# cat HYQH-BJ.cfg | grep -A 3 -B 3 Flow

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.BJ

       service_description     serial 0/0/0:0 Flow

       check_command           check_snmp!-C HYQH.BJ -o ifInOctets.7 -w 5000000000-6000000000 -c 6000000000-8000000000     ; The total number of octets received on the interface,including framing characters

       }

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.BJ

       service_description     serial 0/0/1:0 Flow

       check_command           check_snmp!-C HYQH.BJ -o ifInOctets.8 -w 5000000000-6000000000 -c 6000000000-8000000000

       }

# cat HYQH-SH.cfg | grep -v "#" |grep -A 3 -B 3 Flow

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.SH

       service_description     Serial0/0/0:0 Flow

       check_command           check_snmp!-C SH -o ifInOctets.11 -w 5000000000-6000000000 -c 6000000000-8000000000     ; The total number of octets received on the interface,including framing characters

       }

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.SH

       service_description     Serial0/0/1:0 Flow

       check_command           check_snmp!-C SH -o ifInOctets.12 -w 5000000000-6000000000 -c 6000000000-8000000000     ; The total number of octets received on the interface,including framing characters

       }

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.SH

       service_description     Serial0/1/1:0 Flow

       check_command           check_snmp!-C SH -o ifInOctets.14 -w 5000000000-6000000000 -c 6000000000-8000000000     ; The total number of octets received on the interface,including framing characters

       }

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.SH

       service_description     Serial0/2/0:0 Flow

       check_command           check_snmp!-C SH -o ifInOctets.15 -w 5000000000-6000000000 -c 6000000000-8000000000     ; The total number of octets received on the interface,including framing characters

       }

# cat HYQH-ZQ.cfg | grep -v "#" |grep -A 3 -B 3 Flow

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.ZQ

       service_description     serial 0/0/0:0 Flow

       check_command           check_snmp!-C ZQ -o ifInOctets.7 -w 5000000000-6000000000 -c 6000000000-8000000000     ; The total number of octets received on the interface,including framing characters

       }

define service{

       use                     generic-service,srv-pnp

       host_name               HYQH.ZQ

       service_description     serial 0/0/1:0 Flow

       check_command           check_snmp!-C ZQ -o ifInOctets.8 -w 5000000000-6000000000 -c 6000000000-8000000000

       }

Create a classified directory&&Creating the configuration file:

# mkdir ../Servicegroups/

# vi ../Servicegroups/Flow.cfg

define servicegroup{

       servicegroup_name       HYQH.BJ-Flow

       alias                   HYQH.BJ

       members                 HYQH.BJ,serial 0/0/0:0 Flow,HYQH.BJ,serial 0/0/1:0 Flow

}

define servicegroup{

       servicegroup_name       HYQH.SH-Flow

       alias                   HYQH.SH

       members                 HYQH.SH,Serial0/0/0:0 Flow,HYQH.SH,Serial0/0/1:0 Flow,HYQH.SH,Serial0/1/1:0 Flow,HYQH.SH,Serial0/2/0:0 Flow

}

define servicegroup{

       servicegroup_name       HYQH.ZQ-Flow

       alias                   HYQH.ZQ

       members                 HYQH.ZQ,serial 0/0/0:0 Flow,HYQH.ZQ,serial 0/0/1:0 Flow

}

# chown -R nagios:nagios ../Servicegroups/

Modify the main configuration file:

cfg_dir=/etc/nagios/Servicegroups

Check the syntax and restart:

# /usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg

# service nagios restart


当前文章:DefineAServiceGroup
链接地址:http://bzwzjz.com/article/jghgec.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站制作 成都网站设计 成都网站设计 成都做网站建设公司 app网站建设 网站建设 成都网站建设 成都营销网站制作 阿坝网站设计 定制级高端网站建设 成都网站设计 营销网站建设 专业网站建设 营销网站建设 网站建设改版 品牌网站建设 网站制作 企业网站设计 成都网站设计 成都网站建设 上市集团网站建设 外贸营销网站建设