Support for macsuck_no_vlan and macsuck_no_devicevlan
This commit is contained in:
@@ -167,9 +167,9 @@ sub store_node {
|
||||
$new->search({vlan => [$vlan, 0, undef]})->first;
|
||||
|
||||
# upgrade old schema
|
||||
$new->search({vlan => [$vlan, 0, undef]})
|
||||
->update({vlan => $vlan});
|
||||
$new->search({vlan => [0, undef]})->delete();
|
||||
|
||||
# new data
|
||||
$new->update_or_create({
|
||||
vlan => $vlan,
|
||||
active => \'true',
|
||||
@@ -222,8 +222,32 @@ sub _get_vlan_list {
|
||||
foreach my $vlan (sort keys %vlans) {
|
||||
my $name = $vlan_names{$vlan} || '(unnamed)';
|
||||
|
||||
# FIXME: macsuck_no_vlan
|
||||
# FIXME: macsuck_no_devicevlan
|
||||
if (ref [] eq ref setting('macsuck_no_vlan')) {
|
||||
my $ignore = setting('macsuck_no_vlan');
|
||||
|
||||
if ((scalar grep {$_ eq $vlan} @$ignore) or
|
||||
(scalar grep {$_ eq $name} @$ignore)) {
|
||||
|
||||
debug sprintf
|
||||
' [%s] macsuck VLAN %s - skipped by macsuck_no_vlan config',
|
||||
$device->ip, $vlan;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
if (ref [] eq ref setting('macsuck_no_devicevlan')) {
|
||||
my $ignore = setting('macsuck_no_devicevlan');
|
||||
my $ip = $device->ip;
|
||||
|
||||
if ((scalar grep {$_ eq "$ip:$vlan"} @$ignore) or
|
||||
(scalar grep {$_ eq "$ip:$name"} @$ignore)) {
|
||||
|
||||
debug sprintf
|
||||
' [%s] macsuck VLAN %s - skipped by macsuck_no_devicevlan config',
|
||||
$device->ip, $vlan;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
if (setting('macsuck_no_unnamed') and $name eq '(unnamed)') {
|
||||
debug sprintf
|
||||
|
||||
@@ -342,6 +342,20 @@ Set to true to skip macsuck-ing on VLANs which have no name set. This option
|
||||
may be useful on Cisco Catalyst family devices where ports are a member of a
|
||||
VLAN which is not defined in the VLAN database.
|
||||
|
||||
=head3 C<macsuck_no_vlan>
|
||||
|
||||
Value: List of VLAN names or numbers. Default: Empty List.
|
||||
|
||||
On some devices, per-VLAN macsuck will timeout with specific VLAN numbers. You
|
||||
can put those numbers (or their names) into this list to have them skipped.
|
||||
|
||||
=head3 C<macsucl_no_devicevlan>
|
||||
|
||||
Value: List of "IP:vlan-number" or "IP:vlan-name". Default: Empty List.
|
||||
|
||||
Similar to C<macsuck_no_vlan>, but allows specifying the device root
|
||||
(canonical) IP, in order to restrict VLAN skipping only to some devices.
|
||||
|
||||
=head3 C<macsuck_bleed>
|
||||
|
||||
Value: Boolean. Default: C<false>.
|
||||
@@ -643,14 +657,6 @@ C<get_community>
|
||||
|
||||
=item *
|
||||
|
||||
C<macsuck_no_devicevlan>
|
||||
|
||||
=item *
|
||||
|
||||
C<macsuck_no_vlan>
|
||||
|
||||
=item *
|
||||
|
||||
C<macsuck_timeout>
|
||||
|
||||
=item *
|
||||
|
||||
Reference in New Issue
Block a user