diff options
author | Viktors Tjarve <viktors.tjarve@zabbix.com> | 2016-08-31 16:48:37 +0300 |
---|---|---|
committer | Viktors Tjarve <viktors.tjarve@zabbix.com> | 2016-08-31 16:48:37 +0300 |
commit | 31fb8ab24de7eb213e010f20042834315b4a69ca (patch) | |
tree | d4c41a9ae592b0753f9470170952afa25cef74c6 /misc | |
parent | 36c4e0093c5101cdc2c5f14014beda446a32d031 (diff) |
........S. [ZBX-10830] improved coding style
Diffstat (limited to 'misc')
-rw-r--r-- | misc/snmptrap/zabbix_trap_receiver.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/misc/snmptrap/zabbix_trap_receiver.pl b/misc/snmptrap/zabbix_trap_receiver.pl index 3dad69c7fad..dcc941e931e 100644 --- a/misc/snmptrap/zabbix_trap_receiver.pl +++ b/misc/snmptrap/zabbix_trap_receiver.pl @@ -71,7 +71,8 @@ sub zabbix_receiver # get the host name my $hostname = $pdu_info{'receivedfrom'} || 'unknown'; - if ($hostname ne 'unknown') { + if ($hostname ne 'unknown') + { $hostname =~ /\[(.*?)\].*/; # format: "UDP: [127.0.0.1]:41070->[127.0.0.1]" $hostname = $1 || 'unknown'; } @@ -89,8 +90,8 @@ sub zabbix_receiver { if ($pdu_info{$key} !~ /^[[:print:]]*$/) { - my $OctetAsHex = unpack('H*',$pdu_info{$key}) ; # convert octet string to hex - $pdu_info{$key} = "0x$OctetAsHex" ; # apply 0x prefix for consistency + my $OctetAsHex = unpack('H*', $pdu_info{$key}); # convert octet string to hex + $pdu_info{$key} = "0x$OctetAsHex"; # apply 0x prefix for consistency } printf OUTPUT_FILE " %-30s %s\n", $key, $pdu_info{$key}; |