当前位置:网站首页>解决Zabbix用snmp监控网络流量不准的问题
解决Zabbix用snmp监控网络流量不准的问题
2022-07-03 17:48:00 【星哥玩云】
公司新上了一个新的数据中心,需要用zabbix监控华三交换机的网络流量。
配好snmp协议之后,正常都能识别,但慢慢的发现一个问题,电信的接口经常出现少数据的情况,但联通和铁通都没有什么问题。
zabbix绘的图断断续续的,有时更神奇的是,流量突然下降,下降的还很离谱,从500多Mbps一下掉到40多Mbps,一度以为是交换机返回的数据有问题了。
后来在zabbix机器上抓包,发现数据包没有丢,数据也没有什么异常,不过抓的包里面,有个counter32引起注意。
然后仔细阅读snmp的文档,发现snmp协议返回的ifInOctets和ifOutOctets都是流量的总量,而我们都是取两次的差值,然后除以取样的间隔时间,得出的平均值。
而counter32的数据类型计数的最大值是2的32次方减1,当超过4G的时候,计数器就会清零。
后来分析zabbix的snmp interface的模板,发现zabbix取样时间是1分钟,在我们由于流量大,很快就清零了,并且有时计数清零之后新增的数值,比上一次的计数还要大,zabbix还以为没清过零,直接相减除以了时间间隔,就造成了“网络流量陡降的假象”。
找到原因之后,剩下的就好办了,我们需要的是,使用counter64的oid数据。
在zabbix中导出template snmp interfaces模板,然后修改一下名字,重新导入。修改这个新的模板:
在“探索规则”中找到“项目原型”,点击“Incoming traffic on interface {#SNMPVALUE}”,
1.将其“键值”中的ifInOctets[{#SNMPVALUE}]修改为ifHCInOctets[{#SNMPVALUE}]
2.将“SNMP OID”中的IF-MIB::ifInOctets.{#SNMPINDEX}修改为IF-MIB::ifHCInOctets.{#SNMPINDEX}
同样:“项目原型”中的“Outgoing traffic on interface {#SNMPVALUE}”也做类似修改。
也就是将ifInOctets和ifOutOctets替换为ifHCInOctets和ifHCOutOctets。
然后把主机删除,重新添加主机,这次一切都清爽了,绘的图都是连续的,也没再出现陡增陡降的问题。
边栏推荐
- 自动渗透测试工具核心功能简述
- ArrayList分析3 : 删除元素
- The gbase 8A database does not support the DB2 function value (column_name, 0) cluster syntax
- TensorBoard快速入门(Pytorch使用TensorBoard)
- Leetcode Valentine's Day Special - looking for a single dog
- Talk about the design and implementation logic of payment process
- [UE4] brush Arctic pack high quality Arctic terrain pack
- PUT vs. POST for Uploading Files - RESTful API to be Built Using Zend Framework
- Embedded-c language-7
- Automata and automatic line of non-standard design
猜你喜欢
1164 Good in C
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
Select 3 fcpx plug-ins. Come and see if you like them
Investigation on the operation prospect of the global and Chinese Anti enkephalinase market and analysis report on the investment strategy of the 14th five year plan 2022-2028
Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method
TCP拥塞控制详解 | 3. 设计空间
问题随记 —— 在 edge 上看视频会绿屏
SQL injection database operation foundation
PS screen printing brush 131, many illustrators have followed suit
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
随机推荐
MySQL grouping query
Swm32 series Tutorial 4 port mapping and serial port application
Loop through JSON object list
Kotlin的協程:上下文
[combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
Brief introduction to the core functions of automatic penetration testing tool
MinGW compile boost library
Gear2021 monthly update - December
What is the difference between cloud server and cloud virtual machine
Basic grammar of interview (Part 2)
鸿蒙第三次培训
Servlet specification Part II
How to deploy applications on kubernetes cluster
Electronic technology 20th autumn "Introduction to machine manufacturing" online assignment 3 [standard answer]
聊聊支付流程的設計與實現邏輯
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
Select 3 fcpx plug-ins. Come and see if you like them
Financial management (Higher Vocational College) financial management online Assignment 1 in autumn 20
University of Electronic Science and technology, accounting computerization, spring 20 final exam [standard answer]
QT learning diary 9 - dialog box