温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Define A Service Group

发布时间:2020-08-01 10:49:16 来源:网络 阅读:490 作者:卍伪装卍 栏目:移动开发


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





向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI