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
当前URL:http://pwwzsj.com/article/jghgec.html