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