(plugin) network::cisco::meraki::cloudcontroller::restapi - Add filter option for swicth port
This commit is contained in:
parent
c3dbcd04a4
commit
3c3490a9fd
|
@ -299,6 +299,7 @@ sub new {
|
||||||
'filter-organization-id:s' => { name => 'filter_organization_id' },
|
'filter-organization-id:s' => { name => 'filter_organization_id' },
|
||||||
'filter-tags:s' => { name => 'filter_tags' },
|
'filter-tags:s' => { name => 'filter_tags' },
|
||||||
'add-switch-ports' => { name => 'add_switch_ports' },
|
'add-switch-ports' => { name => 'add_switch_ports' },
|
||||||
|
'filter-switch-port:s' => { name => 'filter_switch_port' },
|
||||||
'skip-traffic-disconnect-port' => { name => 'skip_traffic_disconnect_port' },
|
'skip-traffic-disconnect-port' => { name => 'skip_traffic_disconnect_port' },
|
||||||
'skip-clients' => { name => 'skip_clients' },
|
'skip-clients' => { name => 'skip_clients' },
|
||||||
'skip-performance' => { name => 'skip_performance' },
|
'skip-performance' => { name => 'skip_performance' },
|
||||||
|
@ -422,11 +423,15 @@ sub add_switch_port_statuses {
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach (@$ports) {
|
foreach (@$ports) {
|
||||||
|
next if (defined($self->{option_results}->{filter_switch_port}) && $_->{portId} !~ /$self->{option_results}->{filter_switch_port}/i
|
||||||
|
&& $self->{option_results}->{filter_switch_port} ne '' );
|
||||||
|
|
||||||
$self->{devices}->{ $options{serial} }->{device_ports}->{ $_->{portId} } = {
|
$self->{devices}->{ $options{serial} }->{device_ports}->{ $_->{portId} } = {
|
||||||
display => $_->{portId},
|
display => $_->{portId},
|
||||||
port_status => lc($_->{status}),
|
port_status => lc($_->{status}),
|
||||||
port_enabled => $_->{enabled} =~ /True|1/i ? 1 : 0
|
port_enabled => $_->{enabled} =~ /True|1/i ? 1 : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
next if (defined($self->{option_results}->{skip_traffic_disconnect_port}) && $_->{status} =~ /disconnected/i);
|
next if (defined($self->{option_results}->{skip_traffic_disconnect_port}) && $_->{status} =~ /disconnected/i);
|
||||||
|
|
||||||
$self->{devices}->{ $options{serial} }->{device_ports}->{ $_->{portId} }->{traffic_in} = $_->{usageInKb}->{recv} * 1000 * 8,
|
$self->{devices}->{ $options{serial} }->{device_ports}->{ $_->{portId} }->{traffic_in} = $_->{usageInKb}->{recv} * 1000 * 8,
|
||||||
|
@ -580,6 +585,10 @@ Filter devices by tags (Can be a regexp).
|
||||||
|
|
||||||
Add switch port statuses and traffic.
|
Add switch port statuses and traffic.
|
||||||
|
|
||||||
|
=item B<--filter-switch-port>
|
||||||
|
|
||||||
|
Filter switch port (Can be a regexp).
|
||||||
|
|
||||||
=item B<--skip-clients>
|
=item B<--skip-clients>
|
||||||
|
|
||||||
Don't monitor clients traffic on device.
|
Don't monitor clients traffic on device.
|
||||||
|
|
Loading…
Reference in New Issue