Well, I may be able to partially answer my own question, in case it comes up 
for others.

I had put the mibdirs setting in /etc/snmp/snmp.conf, as I was under the 
impression that applied to all of the utilities.  It appears that it does not 
(I'm not even sure it applies to any of them; I am still unclear about where 
these defaults come from).

I found that if I used the -M option on the /etc/default/snmptrapd file and put 
the directory list in there, it worked, but also found I needed to be careful 
about order -- the cisco one needed to come last as some of the others provided 
prerequisites (I could see this in the syslog when starting snmptrapd).

So now I am generally getting the translations I wanted in the traps I receive. 
 And clearly need to study a bit more how the defaults for options work.

Linwood


From: o...@leferguson.com [mailto:o...@leferguson.com]
Sent: Friday, May 13, 2016 12:12 PM
To: net-snmp-users@lists.sourceforge.net
Subject: Trap OID translation with ambiguous symbolic values

I'm using the embedded perl links to run a handler (specifically one from 
Zabbix) for traps.  Running Ubuntu's packaged 5.7.3 version on Ubuntu 15.10.

For certain traps (well, one so far) the translation is not occurring as 
expected, and differs from snmptranslate.

Example: snmptranslate -Dinit_mib 1.3.6.1.4.1.9.9.171.2.0.8

This gives the answer I expected:

registered debug token init_mib, 1
init_mib: Seen MIBDIRS: Looking in 
'/usr/share/snmp/mibs:/var/lib/mibs/cisco:/var/lib/mibs/iana:/var/lib/mibs/ietf'
 for mib dirs ...
init_mib: Seen MIBS: Looking in 
':SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:HOST-RESOURCES-MIB:NOTIFICATION-LOG-MIB:DISMAN-EVENT-MIB:DISMAN-SCHEDULE-MIB:HOST-RESOURCES-TYPES:MTA-MIB:NETWORK-SERVICES-MIB:UCD-DISKIO-MIB:UCD-DLMOD-MIB:LM-SENSORS-MIB:UCD-SNMP-MIB:UCD-DEMO-MIB:SNMP-TARGET-MIB:NET-SNMP-AGENT-MIB:SNMP-MPD-MIB:SNMP-USER-BASED-SM-MIB:SNMP-FRAMEWORK-MIB:SNMP-VIEW-BASED-ACM-MIB:SNMP-COMMUNITY-MIB:IPV6-ICMP-MIB:IPV6-MIB:IPV6-TCP-MIB:IPV6-UDP-MIB:IP-FORWARD-MIB:NET-SNMP-PASS-MIB:NET-SNMP-EXTEND-MIB:SNMP-NOTIFICATION-MIB:SNMPv2-TM:NET-SNMP-VACM-MIB:CISCO-IPSEC-FLOW-MONITOR-MIB'
 for mib files ...
init_mib: Seen PREFIX: Looking in '.1.3.6.1.2.1' for prefix ...
CISCO-IPSEC-FLOW-MONITOR-MIB::cipSecTunnelStop

But the snmptrapd output:

SNMPv2-MIB::snmpTrapOID.0      type=6  value=OID: 
SNMPv2-SMI::enterprises.9.9.171.2.0.7

This has been formatted by the perl script, but not translated.  For

I am running snmptrapd using these settings:

/etc/default/snmptrapd:
 TRAPDOPTS='-OS -t -p /run/snmptrapd.pid'

I do not believe there are other config options affecting it.  I can change the 
OID presentation with the -O in that file so it seems "connected".  In addition 
I specify mibs in /etc/default/snmp

mibdirs  
/usr/share/snmp/mibs:/var/lib/mibs/cisco:/var/lib/mibs/iana:/var/lib/mibs/ietf
mibs +CISCO-IPSEC-FLOW-MONITOR-MIB

The last line explicitly adds the MIB in which this OID is found.

The two symbolic representations both appear to yield the same numeric value, 
indeed the snmpwalk will turn one into the other (I realize it should not 
retrieve it, it is the translation I am looking at:

# snmpwalk -v2c -cRedacted 10.200.14.1  SNMPv2-SMI::enterprises.9.9.171.2.0.7
CISCO-IPSEC-FLOW-MONITOR-MIB::cipSecTunnelStart = No Such Object available on 
this agent at this OID

So my GUESS is that my problem is sequence of MIB's.  There's a -PR option 
documented to reverse the order, but this does not work as an SNMPTRAPD option 
(and frankly I'm not sure reversing is right, as it might cause additional 
issues with other MIB's).

Is there an appropriate way to force this, to use this mib first perhaps (but 
not reverse all of them), or....

My goal is to get more human readable values in the traps.  I realize 
ultimately I could process it in either form, or just in a numeric form, but 
humans are more picky.

Thanks in advance for any advice.  Maybe I'm just approaching this incorrectly.

Linwood




------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to