Page 1 of 3

snmptt not expanding the mib variables properly

Posted: Thu Feb 05, 2015 1:59 pm
by tbyrne
Snmptt is supposed to be able to parse a loaded mib file and replace integer values with their corresponding string values.
I have modified the snmptt.ini file with the proper changes. See snmptt.ini listed below.
I have a mib that has 27 different values for device types, and 9 for device status which makes this important option to get working correctly. My only other option would be to write a script to generate my own trap message to pass off to snmptraphandling.py
Snmptt will properly expand integer values and display the variable information properly for the first trap message received but all subsequent trap messages will always display the same expanded (integer) values.
Example:
sbdJam device type:
1) Mag-card reader
2) Printer
3) Ocr
4) Scanner
For the first trap message received for a sbdJam of 1 for the device type I see in the trap log mag-card reader
When I send any other integer value, I receive the same mag-card reader. Any octetstring values will display properly.
I tried sending the same trap message from a second system and receive the same results. I also tried sending several different trap messages and always the first shows the proper expanded values that correspond to the integer values and any subsequent similar traps with different integer values will always show the original (first) value.
When I restart the snmptt service the first message is parsed and displayed properly, but the same problem persists.
SNMPTT.INI
#
# SNMPTT v1.4beta2 Configuration File
#
# Linux / Unix
#


resolve_value_ip_addresses = 0

net_snmp_perl_enable = 1

net_snmp_perl_cache_enable = 1


net_snmp_perl_best_guess = 0

translate_log_trap_oid = 1

translate_value_oids = 1

translate_enterprise_oid_format = 1

translate_trap_oid_format = 1

translate_varname_oid_format = 1

translate_integers = 1

mibs_environment = ALL

wildcard_expansion_separator = " "

allow_unsafe_regex = 0

remove_backslash_from_quotes = 0

dynamic_nodes = 0

description_mode = 0

description_clean = 1

threads_enable = 1

threads_max = 10

daemon_fork = 1

daemon_uid = snmptt

pid_file = /var/run/snmptt.pid

spool_directory = /var/spool/snmptt/

sleep = 5

Re: snmptt not expanding the mib variables properly

Posted: Thu Feb 05, 2015 6:03 pm
by tgriep
It looks like there are some settings missing in your INI file.

Did you go through these instructions for Integrating SNMP Traps With Nagios XI?

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

Re: snmptt not expanding the mib variables properly

Posted: Thu Feb 05, 2015 7:21 pm
by Box293
Can you also provide us with your snmptt file which contains the defined trap EVENTs

Re: snmptt not expanding the mib variables properly

Posted: Fri Feb 06, 2015 5:11 pm
by tbyrne
Here is the snmptt.ini file along with one of the snmptt.conf files.
I also added two of the mib files for our systems.

Re: snmptt not expanding the mib variables properly

Posted: Sun Feb 08, 2015 6:44 pm
by Box293
Can you please post:

/etc/snmp/snmptt.conf
/etc/snmp/snmptt.conf.sita
/etc/snmp/snmptt.conf.hp
/etc/snmp/snmptt.conf.vmware

Re: snmptt not expanding the mib variables properly

Posted: Mon Feb 09, 2015 10:01 am
by tbyrne
Here are the files.

Re: snmptt not expanding the mib variables properly

Posted: Mon Feb 09, 2015 10:16 am
by tbyrne
Here is the last file

Re: snmptt not expanding the mib variables properly

Posted: Mon Feb 09, 2015 3:48 pm
by tbyrne
Would it be possible to move this discussion to the Nagiox XI customer support forum?

Thanks,

Re: snmptt not expanding the mib variables properly

Posted: Mon Feb 09, 2015 6:00 pm
by Box293
I think I know what is going on but I need to gather some more information from you.
tbyrne wrote:Snmptt will properly expand integer values and display the variable information properly for the first trap message received but all subsequent trap messages will always display the same expanded (integer) values.
Can you show some actual messages that provide examples of this.
tbyrne wrote:For the first trap message received for a sbdJam of 1 for the device type I see in the trap log mag-card reader
When I send any other integer value, I receive the same mag-card reader. Any octetstring values will display properly.
Same again here, provide actual log message examples.



I'll need to get an admin to move this to the customer support forum.

Re: snmptt not expanding the mib variables properly

Posted: Tue Feb 10, 2015 11:26 am
by tbyrne
OK, I setup only the one mib file sita_pm_sbd.mib and modified only the one trap message sbdBaggage. I figure this would make it easier to troubleshoot.
I uploaded in a zip snmptt.conf, snmptt.ini, snmptt.log, snmpttsystem.log, and snmpd.conf

here is the line I modified
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "sbdBagageStatus: device name - $1, Connection status - $2, bagage status - $3 SQNI Raw: $4"

I have determined that the sting values will always display properly, the problem is with integer values being expaned(substituted) for the mib text values.

$1 sbdDeviceName stirng
$2 sbdConnStatus options 1) unknown, 2)unreachable, 3) online, 4) offline, 5) power-Off, 6) maintenance-mode
$3 sbdBaggageStatus options 1) unknown, 2) normal, 3) technical-error, 4) unknown-error 5) intrusion-detected ..... there are 12 total options here..
$4 sbdSQNIRaw string

I restarted snmptt service

first trap of 1) test_device, 2) 1, 3) 1, 4) blank
second trap 1) test_device, 2) 2, 3) 2, 4) blank no values
third trap 1) test_device, 2) 3, 3) 3, 4) blank no values

restarted snmptt service

fourth trap 1) test_device, 2) 4, 3) 4, 4) blank no values
fifth trap 1) test_device, 2) 5, 3) 5, 4) blank no values

restarted snmptt service

sixth trap 1) test_device, 2) 4, 3) 4, 4) blank no values