snmp的流量问题,高手请进!

likethewind 2005-07-26 03:59:39
我现在写好了一个snmp的程序,运行没有问题,但有一个奇怪的地方.我获取OID为1.3.6.1.2.1.4.3的数据,这是返回当前设备所有端口收到的总IP数据包的数值,现在每隔10秒获得一次该数据,2次的差值就是流量了.
现在程序访问cisco的交换机,它2次的差值很小,它好像没有统计到通过自身流入流出的数据,而只统计了该交换机IP地址的数据,目的IP地址为比如该交换机IP地址为172.17.254.21,那么我telnet到172.17.254.21上,它的2次差值就增大,而接在该交换机上的多台电脑之间的流量就没有计算入内.
这是怎么会事情呢?我想要统计该交换机所有IP数据包的流入与流出该选用MIB中的哪个数值呢?请赐教啊!
...全文
189 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
开始远离编程 2005-07-26
  • 打赏
  • 举报
回复
IP-MIB!ipInReceives (1.3.6.1.2.1.4.3)
The total number of input datagrams received from interfaces, including those received in error.
流量的话,你看看是不是这个
IF-MIB!ifSpeed (1.3.6.1.2.1.2.2.1.5)
An estimate of the interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. If the bandwidth of the interface is greater than the maximum value reportable by this object then this object should report its maximum value (4,294,967,295) and ifHighSpeed must be used to report the interace's speed. For a sub-layer which has no concept of bandwidth, this object should be zero.
likethewind 2005-07-26
  • 打赏
  • 举报
回复
高手出来啊,平定江湖啊
likethewind 2005-07-26
  • 打赏
  • 举报
回复
高手出来啊,平定江湖啊
likethewind 2005-07-26
  • 打赏
  • 举报
回复
重新写一下哈
我现在写好了一个snmp的程序,运行没有问题,但有一个奇怪的地方.我获取OID为1.3.6.1.2.1.4.3的数据,这是返回当前设备所有端口收到的总IP数据包的数值,现在每隔10秒获得一次该数据,2次的差值就是流量了.
现在程序访问cisco的交换机,它2次的差值很小,它好像没有统计到通过自身流入流出的数据,而只统计了目的IP地址为该交换机IP地址的数据,比如该交换机IP地址为172.17.254.21,那么我telnet到172.17.254.21上,它的2次差值就增大,而接在该交换机上的多台电脑之间的流量就没有计算入内.
这是怎么会事情呢?我想要统计该交换机所有IP数据包的流入与流出该选用MIB中的哪个数值呢?请赐教啊!
AntonlioX 2005-07-26
  • 打赏
  • 举报
回复
up

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧