Support for macsuck_no_vlan and macsuck_no_devicevlan

This commit is contained in:
Oliver Gorwits
2013-08-26 21:22:15 +01:00
parent 82a9f18347
commit 0aecbb18a5
4 changed files with 45 additions and 12 deletions

View File

@@ -6,6 +6,7 @@
* Support store_modules config (default true)
* Support for discover_min_age, macsuck_min_age, arpnip_min_age
* Support for macsuck_no, macsuck_only, arpnip_no, arpnip_only
* Support for macsuck_no_vlan and macsuck_no_devicevlan
[BUG FIXES]

View File

@@ -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

View File

@@ -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 *

View File

@@ -67,6 +67,8 @@ discover_no_type: []
macsuck_all_vlans: false
macsuck_no_unnamed: false
macsuck_bleed: false
macsuck_no_vlan: []
macsuck_no_devicevlan: []
store_wireless_clients: true
store_modules: true
ignore_interfaces: