1

I am using SNMP (from the port net-mgmt/net-snmp, v5.7.2, compiled with "MFD_REWRITES") on a FreeBSD9.1-RELEASE system. For some reason, the ifXTable MIB (1.3.6.1.2.1.31.1.1.1) seems to be missing the HC counters (like ifHCInOctets (1.3.6.1.2.1.31.1.1.1.6) for example).

get (noSuchName) There is no such variable name in this MIB.
snmpget localhost <hostname> 1.3.6.1.2.1.31.1.1.1.6.5
snmpget localhost <hostname> ifHCInOctets.5
snmp error index = 1

And when listing 1.3.6.1.2.1.31.1.1.1 I get

usbus0 ifName.1
...
vr0 ifName.5
...
re0 ifName.8
...
re0.10 ifName.12
...
tun0 ifName.17
...
79144352 ifInMulticastPkts.5
...
120009 ifInMulticastPkts.8
...
43670 ifInMulticastPkts.12
...
0 ifInBroadcastPkts.5
...
0 ifOutMulticastPkts.5
...
0 ifOutBroadcastPkts.5
...
100 ifHighSpeed.5
...
1000 ifHighSpeed.8
...
false ifPromiscuousMode.5
...
true ifConnectorPresent.5
...
 ifAlias.5
...
0:00:00 ifCounterDiscontinuityTime.5
...

To me it seems as if "a lot" was there. But not the ifHC[In|Out]Octets...

As you can see my interfaces use the "vr" (Via Rhine) and "re" (Realtek). Does anyone have a hint?

1 Answer 1

3

I found that the problem seems to be my querying: for some (unknown) reason the perl module SNMP::Util that I am using unconditionally submits SNMP queries using protocol version 1. And SNMP v1 cannot handle 64-bit counters.

So I tried using Net::SNMP::Util instead which let's you specify the SNMP protocol version to use. And voilà, it works.

Using snmpwalk from the shell also reveals this:

$ snmpwalk -Os -c <community> -v 1 localhost 1.3.6.1.2.1.31.1.1.1 | grep 'ifHC.*Octets' |wc -l
   0
$ snmpwalk -Os -c <community> -v 2c localhost 1.3.6.1.2.1.31.1.1.1 | grep 'ifHC.*Octets' |wc -l
  34
$ snmpwalk -Os -c <community> localhost 1.3.6.1.2.1.31.1.1.1 | grep 'ifHC.*Octets' |wc -l
  34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .