From 81fccad06e64ce15a48c696f2482587740749c99 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 2 Jun 2020 09:06:06 +0200 Subject: [PATCH] update versa --- network/versa/snmp/mode/devices.pm | 16 ++++++++++++++-- network/versa/snmp/mode/ipsec.pm | 2 +- network/versa/snmp/mode/qospolicy.pm | 1 - network/versa/snmp/mode/sdwan.pm | 3 +-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/network/versa/snmp/mode/devices.pm b/network/versa/snmp/mode/devices.pm index 3e7fc25e5..43bc071cf 100644 --- a/network/versa/snmp/mode/devices.pm +++ b/network/versa/snmp/mode/devices.pm @@ -115,7 +115,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; - $options{options}->add_options(arguments => { + $options{options}->add_options(arguments => { + 'filter-vsn-id:s' => { name => 'filter_vsn_id' } }); return $self; @@ -148,6 +149,12 @@ sub manage_selection { my $result = $options{snmp}->map_instance(mapping => $mapping_device, results => $snmp_result, instance => $instance); + if (defined($self->{option_results}->{filter_vsn_id}) && $self->{option_results}->{filter_vsn_id} ne '' && + $result->{vsn_id} !~ /$self->{option_results}->{filter_vsn_id}/) { + $self->{output}->output_add(long_msg => "skipping device '" . $result->{vsn_id} . "'.", debug => 1); + next; + } + $self->{devices}->{ $result->{vsn_id} } = $result; $self->{devices}->{ $result->{vsn_id} }->{sessions_active_prct} = $result->{sessions_active} * 100/ $result->{sessions_max}; $self->{devices}->{ $result->{vsn_id} }->{sessions_failed_prct} = $result->{sessions_failed} * 100/ $result->{sessions_max}; @@ -169,10 +176,15 @@ Check device system statistics (cpu, memory, sessions). Only display some counters (regexp can be used). Example: --filter-counters='cpu_load' +=item B<--filter-vsn-id> + +Filter monitoring on vsn id (can be a regexp). + =item B<--warning-*> B<--critical-*> Thresholds. -Can be: 'cpu', 'memory', 'active-sessions', 'failed-sessions', 'sessions-used-prct', 'sessions-free-prct'. +Can be: 'cpu-utilization', 'memory-usage', 'sessions-active', 'sessions-active-prct', +'sessions-failed', 'sessions-failed-prct'. =back diff --git a/network/versa/snmp/mode/ipsec.pm b/network/versa/snmp/mode/ipsec.pm index 4faec049d..352ee99c5 100644 --- a/network/versa/snmp/mode/ipsec.pm +++ b/network/versa/snmp/mode/ipsec.pm @@ -191,7 +191,7 @@ Check ipsec tunnels. =item B<--filter-counters> Only display some counters (regexp can be used). -Example: --filter-counters='qos-policy-hit' +Example: --filter-counters='traffic' =item B<--filter-org> diff --git a/network/versa/snmp/mode/qospolicy.pm b/network/versa/snmp/mode/qospolicy.pm index f3df39fbf..192b59819 100644 --- a/network/versa/snmp/mode/qospolicy.pm +++ b/network/versa/snmp/mode/qospolicy.pm @@ -352,7 +352,6 @@ A policy may have 1 to n associated rules =item B<--filter-rule> Filter monitoring on 'rule' -rule name- (can be a regexp) -Rules are unique =item B<--warning-*> B<--critical-*> diff --git a/network/versa/snmp/mode/sdwan.pm b/network/versa/snmp/mode/sdwan.pm index 2e65792c8..9a508f41e 100644 --- a/network/versa/snmp/mode/sdwan.pm +++ b/network/versa/snmp/mode/sdwan.pm @@ -233,7 +233,7 @@ Check SD-Wan rules. =item B<--filter-counters> Only display some counters (regexp can be used). -Example: --filter-counters='qos-policy-hit' +Example: --filter-counters='traffic' =item B<--filter-org> @@ -248,7 +248,6 @@ A policy may have 1 to n associated rules =item B<--filter-rule> Filter monitoring on 'rule' -rule name- (can be a regexp) -Rules are unique =item B<--warning-*> B<--critical-*>