[ZBXNEXT-6728] Fix zabbix_trap_receiver.pl to use MIB for received VALUES translation.(OID already translates) Created: 2021 Jun 15  Updated: 2022 Apr 19

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Change Request Priority: Trivial
Reporter: Andrey Tocko (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File snmp_perl.png     File zabbix_trap_receiver_values_translated.pl    
Issue Links:
Causes

 Description   

Currently zabbix_trap_receiver.pl scripts is not able to translate\substitute integer values of received traps even if MIB holds description on it.
On next screenshot we can see it marked with red. Then we can see how community fix solves this problem, - marked with blue.

This fix was done by community back in 2017:
https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/37733-snmp-traps-translate
It is time to improve script in zabbix git.

Community solution:
zabbix_trap_receiver_values_translated.pl



 Comments   
Comment by Isaque Profeta [ 2022 Apr 19 ]

Patch below has tested on 5.4 version zabbix_trap_receiver.pl, add it on line 104 inside foreach my $x (@varbinds) and before the printf inside the loop:

 

 

my $oid = $x->[0];
my $value = $x->[1];
$value =~ m/^([\w-]+): .+$/;
$type = $1;
$value =~ s/$type: //g;
if ($translate = &SNMP::translateObj($oid, $value)) {
    $value = "$type: $value ($translate)";
} else {
    $value = "$type: $value";
}

 

 

Generated at Fri May 02 07:51:53 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.