修复内核版本低于2.6.33时取不到net.if.speed.bits值的问题 #15
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pr 9 中实现了抓取网卡参数:
net.if.speed.bits,net.if.in.percent,net.if.out.percent
的功能,当内核版本低于2.6.33
时是不存在/sys/class/net/<nic>/speed
文件的,doc in here, 此时无法获取到网卡的真实值当内核版本低于
2.6.33
时, 可以使用ethtool
命令来实现这个功能,已经在线上机器CentOS 5.5 Kernel version 2.6.18
的环境中验证生效