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号
友情链接: 成都网站建设流程 宜宾网站设计 温江网站设计 成都定制网站建设 营销网站建设 成都网站制作 品牌网站建设 网站制作 外贸网站设计方案 专业网站建设 H5网站制作 成都商城网站建设 企业手机网站建设 成都商城网站制作 网站建设 高端网站建设 温江网站设计 网站建设公司 广安网站设计 成都网站建设公司 成都品牌网站建设 企业网站建设