Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增Discards和Errors采集函数。 #5

Merged
merged 1 commit into from
Aug 14, 2016

Conversation

zzlyzq
Copy link

@zzlyzq zzlyzq commented Jul 7, 2016

兄弟, 修改了一共两个文件 ifstat.go 和 ifstat_snmpwalk.go。
最关键的是 关于strconv的方法, 对于流量、组播、广播计数的类型,snmp表示是 COUNTER64,但是对于 discards和errors丢包,snmp表示是 COUNTER32。 前者对应于go是 ParseUint64,对于后者则是 Atoi。

这个地方卡了我很长时间,在V2EX里面也提问了http://v2ex.com/t/290255。 最后是通过reflect打印日志,看看到底是啥, 发现go识别 COUNTER32是 int。

我开发经验少,还不如三脚猫, 代码里面修改的可能会有些乱,还望兄弟包涵。

大家一起努力。 加油~
By LeEco bigdata-ops Team

@freedomkk-qfeng freedomkk-qfeng merged commit 57f59dc into gaochao1:master Aug 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants