通过snmp获取带宽流量并计算

匿名 (未验证) 提交于 2019-12-03 00:43:02

1、安装snmp及本地mib库

apt-get install snmp snmp-mibs-downloader

2、获取接口带宽:


3、带宽计算:

providing an example is a good idea.
time= 60 seconds
Diff. Inoctets = 1427697887 - 1427402450 = 295437 octets received in 60 seconds
1 octet = 8 bits
average bit rate = Diff.InOcoctets*8/60 =
39391,6 bps
so the usage is :
39391,6 / 1544000 = 2,55 % usage of BW inbound direction
you can perform a similar calculation for outbound direction

修改本地配置,vim /etc/snmp/snmp.conf
注释#mibs

来源:https://blog.csdn.net/wang1144/article/details/52399589

原文:https://www.cnblogs.com/guoqp/p/9348037.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!