How do I collect bandwidth utilization data on remote devices/switches/servers?

前端 未结 1 1220
陌清茗
陌清茗 2021-01-15 05:03

How do I collect bandwidth usage/utilzation on devices/switches. From what I understand there are systems that do something like this. They seem to all have snmp in common.<

1条回答
  •  别那么骄傲
    2021-01-15 05:49

    On pure SNMP point of view, there is a Management Information Base (MIB) on your SNMP device.

    This base is a kind of tree where datas are named using Object IDentifiers (OIDs). One of these datas is a counter called "ifInOctets" in the interface group of MIBII, it represents the number of "In" octets on one of the interface of the SNMP device, another one ("ifOutOctets") represent the number of "Out" octets. You will find in your favorite language (PHP) a way to get these two counters. You also have the information of the interface speed in "ifSpeed" counter. With NET-SNMP tools installed (on Linux or Microsoft) you can get the information with "snmpget"

    enter image description here

    snmpget -v 1 -c public localhost ifInOctets.65539
    IF-MIB::ifInOctets.65539 = Counter32: 82929271

    Imagine you take 2 values of "ifInOctets" I1 and I2 with an interval of S seconds. You can compute your "In" bandith.

    "In" Bandwith usage in % = (((I2-I1) * 8)*100) / (ifSpeed * S)

    If you just want to have a nice graph of the bandwith usage of your device just try MRTG tool.

    enter image description here

    Best regards.

    JP

    0 讨论(0)
提交回复
热议问题