Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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

share|improve this answer
    
Thanks. As a beginner this helped me adjust my tutorial commands –  Dark Star1 Jan 10 at 9:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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