Skip to content

Changed Create trap key section#11

Open
deshike22 wants to merge 1 commit intozabbix-tools:masterfrom
deshike22:master
Open

Changed Create trap key section#11
deshike22 wants to merge 1 commit intozabbix-tools:masterfrom
deshike22:master

Conversation

@deshike22
Copy link

$oid =~ s/./\./g; # replaces a . with . However when receiving trap alerts it comes with partially translated trapoid
Eg:
SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.789.0.13

It does not match with full oid created in the code.

Also $item->{ key } = "snmptrap["\s$oid\s"]"; # surrounds with the oid with \s. When I checked it with http://www.rexv.org/ under posix regex none of those matched. Therefore item key had to change.
$item->{ key } = "snmptrap["$oid"]";

Please note that this was tested only on NETAPP-MIB

$oid =~ s/\./\\./g;  # replaces a . with \. However when receiving trap alerts it comes with partially translated trapoid
Eg: 
  SNMPv2-MIB::snmpTrapOID.0      type=6  value=OID: SNMPv2-SMI::enterprises.789.0.13

It does not match with full oid created in the code.

Also $item->{ key } = "snmptrap[\"\\s$oid\\s\"]";  # surrounds with the oid with \s. When I checked it with http://www.rexv.org/ under posix regex none of those matched. Therefore item key had to change. 
$item->{ key } = "snmptrap[\"$oid\"]";
 
Please note that this was tested only on NETAPP-MIB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant