Log at debug the vlan reindexing in macsuck

This commit is contained in:
Oliver Gorwits
2014-08-06 23:20:16 +01:00
parent 97efd3b920
commit d9d2ea6b51
2 changed files with 9 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
* Do not leak SNMP community string into debug output (unless SHOW_COMMUNITY=1) * Do not leak SNMP community string into debug output (unless SHOW_COMMUNITY=1)
* Process tree updated to show daemon worker status/activity * Process tree updated to show daemon worker status/activity
* Handle management IP of one device being in use on another device * Handle management IP of one device being in use on another device
* Log at debug the vlan reindexing in macsuck
[BUG FIXES] [BUG FIXES]

View File

@@ -374,7 +374,7 @@ community indexing, with the given C<$vlan> ID. Works for all SNMP versions.
sub snmp_comm_reindex { sub snmp_comm_reindex {
my ($snmp, $device, $vlan) = @_; my ($snmp, $device, $vlan) = @_;
my $ver = $snmp->snmp_ver; my $ver = $snmp->snmp_ver;
if ($ver == 3) { if ($ver == 3) {
my $prefix = ''; my $prefix = '';
@@ -385,10 +385,17 @@ sub snmp_comm_reindex {
$prefix = $c->{context_prefix} and last; $prefix = $c->{context_prefix} and last;
} }
$prefix ||= 'vlan-'; $prefix ||= 'vlan-';
debug
sprintf '[%s] reindexing to "%s%s" (ver: %s, class: %s)',
$device->ip, $prefix, $vlan, $ver, $snmp->class;
$snmp->update(Context => ($prefix . $vlan)); $snmp->update(Context => ($prefix . $vlan));
} }
else { else {
my $comm = $snmp->snmp_comm; my $comm = $snmp->snmp_comm;
debug sprintf '[%s] reindexing to vlan %s (ver: %s, class: %s)',
$device->ip, $vlan, $ver, $snmp->class;
$snmp->update(Community => $comm . '@' . $vlan); $snmp->update(Community => $comm . '@' . $vlan);
} }
} }