snmp 中的MIB变量ifInOctets and ifOutOctets 溢出问题

snmp 中进行流量统计的MIB变量ifInOctets and ifOutOctets 溢出问题

    在MRTG中进行流量统计是通过采集ifInOctets and ifOutOctets ,等过一段时间再采集这两个值,然后进行相减就得出这一

段时间的平均流量,如果这个数出现溢出就会出现问题。     


snmp 中进行流量统计的MIB变量ifInOctets and ifOutOctets 溢出问题

    在MRTG中进行流量统计是通过采集ifInOctets and ifOutOctets ,等过一段时间再采集这两个值,然后进行相减就得出这一段时间的平均流量,如果这个数出现溢出就会出现问题。
     在使用MRTG进行网络接口的流量统计时,发现一个溢出问题。由于ifInOctets and ifOutOctets 的类型是counter是一个32位的无符号数,当流量超100M时,每5分钟采集一次流量就会出现溢出的问题。
 为了解决这个问题,需要使用SNMPV2C版本的MIB变量才好,由于MRTG本身可以支持使用SNMPV2C变量,可以这样设置:
 SNMPv2c

 If you have a fast router you might want to try to poll the ifHC* counters. This feature gets activated by switching to SNMPv2c. Unfortunately not all devices support SNMPv2c yet. If it works, this will prevent your counters from wraping within the 5 minute polling interval, since we now use 64 bit instead of the normal 32 bit.
Example:

 Target[myrouter]: 2:public@router1:::::2 

你可能感兴趣的:(SNMP)