如何从SNMP获取每秒接收和发送的数据字节数

时间:2022-09-17 09:45:49

Now I can get Total Receiving and Total Sent from SNMP already

现在我已经可以从SNMP获得Total Receiving和Total Sent

I want to get Receiving and Sent (Byte per Second) by SNMP

我希望通过SNMP获得接收和发送(每秒字节数)

Help Me Pls.

帮我吧。

http://image.ohozaa.com/i/0b5/shxqpG.png

http://image.ohozaa.com/i/0b5/shxqpG.png

1 个解决方案

#1


1  

By reading ifInOctets and ifOutOctets from the IF-MIB (with OID .1.3.6.1.2.1.2.). As they contain only the total number of octets send/received you have to wait a short amount, query the information again and finally calculate the octets per second from your results.

通过从IF-MIB读取ifInOctets和ifOutOctets(使用OID .1.3.6.1.2.1.2。)。由于它们仅包含发送/接收的八位字节总数,因此您必须等待一小段时间,再次查询信息,最后从结果中计算每秒的八位字节数。

This can be done for example via snmpget ip-address IF-MIB::ifInOctets. Debian ships the snmpget, snmpwalk etc. commands with the snmp package.

这可以通过例如snmpget ip-address IF-MIB :: ifInOctets来完成。 Debian使用snmp包发送了snmpget,snmpwalk等命令。

#1


1  

By reading ifInOctets and ifOutOctets from the IF-MIB (with OID .1.3.6.1.2.1.2.). As they contain only the total number of octets send/received you have to wait a short amount, query the information again and finally calculate the octets per second from your results.

通过从IF-MIB读取ifInOctets和ifOutOctets(使用OID .1.3.6.1.2.1.2。)。由于它们仅包含发送/接收的八位字节总数,因此您必须等待一小段时间,再次查询信息,最后从结果中计算每秒的八位字节数。

This can be done for example via snmpget ip-address IF-MIB::ifInOctets. Debian ships the snmpget, snmpwalk etc. commands with the snmp package.

这可以通过例如snmpget ip-address IF-MIB :: ifInOctets来完成。 Debian使用snmp包发送了snmpget,snmpwalk等命令。