如何在远程设备/交换机/服务器上收集带宽利用率数据? [英] How do I collect bandwidth utilization data on remote devices/switches/servers?

查看:222
本文介绍了如何在远程设备/交换机/服务器上收集带宽利用率数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何收集设备/交换机上的带宽使用/利用率.据我了解,有些系统会执行类似的操作.他们似乎都有共同点.

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.

我正在寻找有关可能滚动我自己的系统来收集此数据的信息,该系统以后将在基于Web的前端中使用.对于现实世界,但也许有些复杂,我正在谈论的例子,请看 ubersmith de .大多数将在LAMP环境中.谢谢.

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.

推荐答案

从纯SNMP的角度来看,您的SNMP设备上有一个管理信息库(MIB).

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

此基础是一棵树,其中使用对象标识符(OID)命名数据.这些数据之一是MIBII接口组中一个称为"ifInOctets"的计数器,它表示SNMP设备的一个接口上的"In"八位字节的数目,另一个("ifOutOctets")代表"Out"的数目.八位位组.您将以自己喜欢的语言(PHP)找到获取这两个计数器的方法.您还可以在"ifSpeed"计数器中获得接口速度的信息.安装了NET-SNMP工具(在Linux或Microsoft上)后,您可以通过"snmpget"获取信息

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

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

想象一下,您以S秒为间隔获取了两个"ifInOctets" I1和I2值.您可以计算您的"In"带宽.

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

"In"频段的使用率以%=(((I2-I1)* 8)* 100)/(ifSpeed * S)

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

如果您只是想了解设备的带宽使用情况,请尝试使用MRTG工具.

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

最诚挚的问候.

JP

这篇关于如何在远程设备/交换机/服务器上收集带宽利用率数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆