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
分享地址:https://www.cdcxhl.com/article42/jghgec.html

成都网站建设公司_创新互联,为您提供软件开发网站维护网站导航外贸建站移动网站建设标签优化

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

网站建设网站维护公司