2

I am installing Zabbix to monitor via snmp some devices from a machine running Ubuntu 12.04 server.

There is a problem with MIB definitions, since snmp commands do no properly translate some of the MIBs. I have already installed the "snmp-mibs-downloader" package, so the files containing the MIB descriptions are properly installed.

The MIB are only translated to obtain the numeric key (the MIB files are accessible to the snmp commands), but the results returned by the snmpget command do not properly translate the key. The zabbix templates that I am using do expect the key translated (SNMPv2-MIB::sysUpTime.0) , so, the current results are not recognised and these are ignored.

Test case:

$ snmptranslate -On SNMPv2-MIB::sysUpTime.0
.1.3.6.1.2.1.1.3.0

$ snmpget -v 2c -c public 192.168.1.1 1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (2911822510) 337 days, 0:23:45.10

On another machine (running a very old Red Hat based distribution), the snmp commands perform both, the direct and reverse traslation, as expected:

# snmptranslate -On SNMPv2-MIB::sysUpTime.0
.1.3.6.1.2.1.1.3.0

# snmpget -v 2c -c public 192.168.1.1 1.3.6.1.2.1.1.3.0
SNMPv2-MIB::sysUpTime.0 = Timeticks: (2911819485) 337 days, 0:23:14.85

What is the problem on my Ubuntu box? Is there something I am missing?

1 Answer 1

4

I find that the following works for me with snmp and snmpd installed on my system:

$ snmpget -m SNMPv2-MIB -v 2c -c public 127.0.0.1 1.3.6.1.2.1.1.3.0
SNMPv2-MIB::sysUpTime.0 = Timeticks: (1422579) 3:57:05.79

There seem to be various overlapping MIBS, so I think it may be necessary to specify which module you want with the -m option.

The following also works:

$ snmpget -v 2c -c public 127.0.0.1 SNMPv2-MIB::sysUpTime.0
SNMPv2-MIB::sysUpTime.0 = Timeticks: (129146) 0:21:31.46

So it seems that if you specify a numeric OID without specifying a MIB module snmpget returns a numeric display, but if you qualify the request with a symbolic reference to a particular MIB that MIB definition is used to interpret the response.

See also man snmp.conf

1
  • Thanks. As a beginner this helped me adjust my tutorial commands
    – Dark Star1
    Jan 10, 2014 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.