当前位置:网站首页>解决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。
然后把主机删除,重新添加主机,这次一切都清爽了,绘的图都是连续的,也没再出现陡增陡降的问题。
边栏推荐
- Comparison of kotlin collaboration + retro build network request schemes
- Talk about the design and implementation logic of payment process
- Notes on problems -- watching videos on edge will make the screen green
- Ml (machine learning) softmax function to realize the classification of simple movie categories
- c# .net 工具生态
- MySQL has been stopped in the configuration interface during installation
- Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
- [combinatorics] recursive equation (the problem of solving recursive equation with multiple roots | the problem is raised)
- Leetcode540: a single element in an ordered array
- AcWing 4489. 最长子序列
猜你喜欢

Hongmeng fourth training

Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method

Select 3 fcpx plug-ins. Come and see if you like them

Getting started with deops

Deops入门

BFS - topology sort

TCP拥塞控制详解 | 3. 设计空间

基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition

How to deploy applications on kubernetes cluster

Introduction to SolidWorks gear design software tool geartrax
随机推荐
问题随记 —— 在 edge 上看视频会绿屏
数学公式(测试)
The difference between i++ and ++i: tell their differences easily
How to enforce parameters in PowerShell- How do I make parameters mandatory in PowerShell?
企业级自定义表单引擎解决方案(十一)--表单规则引擎1
STM32 realizes 74HC595 control
Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
鸿蒙第三次培训
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
MySQL has been stopped in the configuration interface during installation
First day of rhcsa study
Select 3 fcpx plug-ins. Come and see if you like them
Leetcode Valentine's Day Special - looking for a single dog
Embedded-c language-7
Records of long objects and long judgments in the stream of list
[UE4] brush Arctic pack high quality Arctic terrain pack
MySQL grouping query
[combinatorics] recursive equation (the problem of solving recursive equation with multiple roots | the problem is raised)
STM32实现74HC595控制
[vscode] convert tabs to spaces