配置RMON示例
统计接口的流量信息,当流量超过设定值时,向NMS发送告警。
组网需求
如图25-1所示,需要对Device的接口GE0/3/0连接的子网进行监控,包括:
有关流量和各种类型包数量的实时和历史统计信息。
监控此子网的广播和组播信息流量,对该子网的组播和广播总数进行告警设置,当超过设定值时,主动向网管站NM Station上报告警信息。
本例中interface1和interface2分别代表GE0/1/0和GE0/3/0。
配置思路
采用如下的思路配置RMON:
配置路由器和NMS路由可达。
配置SNMP基本功能并设置相应的团体名,保证路由器可以向NMS发送告警信息。
配置RMON统计功能,对端口进行流量统计。
配置RMON告警功能,当采样值超过阈值时向NMS发送告警。
数据准备
为完成此配置例,需准备如下的数据:
RMON统计功能的索引号 1
RMON统计功能的用户名 userA
信息采样时间间隔 30秒
RMON告警功能的索引号 1
告警监控对象的OID 1.3.6.1.2.1.2.2.1.4.3 5
触发告警事件阈值 上限告警阈值1000和下限告警阈值100
RMON告警功能的用户名 userA
操作步骤
- 配置路由器和网管站路由可达(略)
- 配置允许向网管站发送Trap
# 使能SNMP发送Trap的功能。
<HUAWEI> system-view
[~HUAWEI] sysname Device
[*HUAWEI] commit
[~Device] snmp-agent
[*Device] snmp-agent trap enable
# 配置向指定的网管站发送Trap。
[*Device] snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname public
[*Device] commit
- 配置统计功能
# 使能RMON统计功能。
[~Device] interface gigabitethernet 0/3/0
[~Device-GigabitEthernet0/3/0] rmon-statistics enable
[*Device-GigabitEthernet0/3/0] commit
# 配置以太网统计功能。
[~Device-GigabitEthernet0/3/0] rmon statistics 1 owner userA
[*Device-GigabitEthernet0/3/0] commit
# 配置历史采样功能,对子网中的流量信息采样,采样间隔为30秒钟,并保存最近10次数据。
[~Device-GigabitEthernet0/3/0] rmon history 1 buckets 10 interval 30 owner userA
[*Device-GigabitEthernet0/3/0] commit
[~Device-GigabitEthernet0/3/0] quit
- 配置告警功能
# 配置RMON的1号事件向网管站发送Trap消息。
[~Device] rmon event 1 description alarmofinterface trap public owner userA
[*Device] commit
# 配置告警阈值功能,设置采样间隔和触发告警事件1的阈值。
[~Device] rmon alarm 1 1.3.6.1.2.1.2.2.1.4.3 5 absolute rising-threshold 1000 1 falling-threshold 100 1 owner userA
[*Device] commit
[~Device] quit
- 检测配置结果
# 查看子网的数据流量信息。
<Device> display rmon statistics gigabitethernet 0/3/0
Statistics entry 1 owned by userA is valid. Interface : GigabitEthernet0/3/0<ifEntry.402653698> Received : Octets :4294966296, Packets:316091 Broadcast packets :311839 , Multicast packets:666 Undersize packets :0 , Oversize packets :0 Fragments packets :0 , Jabbers packets :0 CRC alignment errors:0 , Collisions :0 Dropped packets (insufficient resources):0 Packets received according to length (octets): 64 :0 , 65-127 :0 , 128-255 :0 256-511:0 , 512-1023:0 , 1024-1518:0
# 查看历史采样记录。
<Device> display rmon history gigabitethernet 0/3/0
History control entry 1 owned by userA is valid Sampled interface : GigabitEthernet0/3/0<ifEntry.402653698> Sampling interval : 30(sec) with 10 buckets max Last Sampling time : 0days 05h:17m:26s.30th Latest sampled values : Octets :1000 , Packets :100 Broadcast packets :100 , Multicast packets :100 Undersize packets :0 , Oversize packets :0 Fragments packets :0 , Jabbers packets :0 CRC alignment errors :0 , Collisions :0 Dropped packet :0 , Utilization :0 History record: Record No.1 (Sample time: 0days 05h:13m:56s.56th) Octets :1000 , Packets :100 Broadcast packets :100 , Multicast packets :100 Undersize packets :0 , Oversize packets :0 Fragments packets :0 , Jabbers packets :0 CRC alignment errors :0 , Collisions :0 Dropped packets :0 , Utilization :0
# 查看事件的处理方式,是记录日志还是发送Trap消息。
<Device> display rmon event
Event table 1 owned by userA is valid. Description: alarmofinterface. Will cause snmp-trap when triggered, last triggered at 1days 04h:00m:00s.04th
# 查看告警的配置信息。
<Device> display rmon alarm 1
Alarm table 1 owned by userA is valid. Samples absolute value : 1.3.6.1.2.1.2.2.1.4.3 Sampling interval : 5(sec) Rising threshold : 1000(linked with event 1) Falling threshold : 100(linked with event 1) When startup enables : risingOrFallingAlarm Latest value : 1500
配置文件
# sysname Device # interface GigabitEthernet0/1/0 undo shutdown ip address 10.2.2.1 255.255.255.0 interface GigabitEthernet0/3/0 undo shutdown ip address 10.3.3.1 255.255.255.0 rmon-statistics enable rmon statistics 1 owner userA rmon history 1 buckets 10 interval 30 owner userA # ip route-static 10.1.1.0 255.255.255.0 10.2.2.2 # snmp-agent # snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname public # rmon event 1 description alarmofinterface trap owner userA rmon alarm 1 1.3.6.1.2.1.2.2.1.4.3 5 absolute rising-threshold 1000 1 falling-threshold 100 1 owner userA # return