如何收集远程设备/交换机/服务器上的带宽利用率数据?
如何收集设备/交换机上的带宽使用情况/利用率。据我了解,有些系统可以做类似的事情。他们似乎都有 snmp 的共同点。
我正在寻找有关可能滚动我自己的系统来收集这些数据的信息,这些数据稍后将在基于网络的前端上使用。对于我所讨论的现实世界但可能有点过于复杂的示例,请查看 ubersmith de< /a>.其中大部分将在 LAMP 环境中进行。谢谢。
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.
I am looking for imformation on possibly rolling my own system for collecting this data that will be later used on a web-based front-end. For a real-world but perhaps a bit over complicated example of what I'm talking about take a look at ubersmith de. Most of it will be in a LAMP environment. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从纯粹的 SNMP 角度来看,您的 SNMP 设备上有一个管理信息库 (MIB)。
该基础是一种树,其中的数据使用对象标识符 (OID) 命名。其中一个数据是 MIBII 接口组中名为“ifInOctets”的计数器,它代表 SNMP 设备的接口之一上“In”八位字节的数量,另一个(“ifOutOctets”)代表“Out”八位字节的数量。 “八位字节。您将在您最喜欢的语言 (PHP) 中找到获取这两个计数器的方法。您还可以在“ifSpeed”计数器中获得接口速度的信息。安装 NET-SNMP 工具(在 Linux 或 Microsoft 上)后,您可以使用“snmpget”获取信息
<代码>snmpget -v 1 -c 公共本地主机 ifInOctets.65539
IF-MIB::ifInOctets.65539 = Counter32: 82929271
假设您以 S 秒的间隔获取“ifInOctets”I1 和 I2 的 2 个值。您可以计算您的“In”带宽。
“In”带宽使用率% = (((I2-I1) * 8)*100) / (ifSpeed * S)
如果您只是想获得设备带宽使用情况的漂亮图表,请尝试 MRTG 工具。
致以诚挚的问候。
太平绅士
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"
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.
Best regards.
JP