Support for macsuck_no_vlan and macsuck_no_devicevlan
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
* Support store_modules config (default true)
|
* Support store_modules config (default true)
|
||||||
* Support for discover_min_age, macsuck_min_age, arpnip_min_age
|
* 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, macsuck_only, arpnip_no, arpnip_only
|
||||||
|
* Support for macsuck_no_vlan and macsuck_no_devicevlan
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|
||||||
|
|||||||
@@ -167,9 +167,9 @@ sub store_node {
|
|||||||
$new->search({vlan => [$vlan, 0, undef]})->first;
|
$new->search({vlan => [$vlan, 0, undef]})->first;
|
||||||
|
|
||||||
# upgrade old schema
|
# upgrade old schema
|
||||||
$new->search({vlan => [$vlan, 0, undef]})
|
$new->search({vlan => [0, undef]})->delete();
|
||||||
->update({vlan => $vlan});
|
|
||||||
|
|
||||||
|
# new data
|
||||||
$new->update_or_create({
|
$new->update_or_create({
|
||||||
vlan => $vlan,
|
vlan => $vlan,
|
||||||
active => \'true',
|
active => \'true',
|
||||||
@@ -222,8 +222,32 @@ sub _get_vlan_list {
|
|||||||
foreach my $vlan (sort keys %vlans) {
|
foreach my $vlan (sort keys %vlans) {
|
||||||
my $name = $vlan_names{$vlan} || '(unnamed)';
|
my $name = $vlan_names{$vlan} || '(unnamed)';
|
||||||
|
|
||||||
# FIXME: macsuck_no_vlan
|
if (ref [] eq ref setting('macsuck_no_vlan')) {
|
||||||
# FIXME: macsuck_no_devicevlan
|
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)') {
|
if (setting('macsuck_no_unnamed') and $name eq '(unnamed)') {
|
||||||
debug sprintf
|
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
|
may be useful on Cisco Catalyst family devices where ports are a member of a
|
||||||
VLAN which is not defined in the VLAN database.
|
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>
|
=head3 C<macsuck_bleed>
|
||||||
|
|
||||||
Value: Boolean. Default: C<false>.
|
Value: Boolean. Default: C<false>.
|
||||||
@@ -643,14 +657,6 @@ C<get_community>
|
|||||||
|
|
||||||
=item *
|
=item *
|
||||||
|
|
||||||
C<macsuck_no_devicevlan>
|
|
||||||
|
|
||||||
=item *
|
|
||||||
|
|
||||||
C<macsuck_no_vlan>
|
|
||||||
|
|
||||||
=item *
|
|
||||||
|
|
||||||
C<macsuck_timeout>
|
C<macsuck_timeout>
|
||||||
|
|
||||||
=item *
|
=item *
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ discover_no_type: []
|
|||||||
macsuck_all_vlans: false
|
macsuck_all_vlans: false
|
||||||
macsuck_no_unnamed: false
|
macsuck_no_unnamed: false
|
||||||
macsuck_bleed: false
|
macsuck_bleed: false
|
||||||
|
macsuck_no_vlan: []
|
||||||
|
macsuck_no_devicevlan: []
|
||||||
store_wireless_clients: true
|
store_wireless_clients: true
|
||||||
store_modules: true
|
store_modules: true
|
||||||
ignore_interfaces:
|
ignore_interfaces:
|
||||||
|
|||||||
Reference in New Issue
Block a user