Fix after review

This commit is contained in:
Sylvain Cresto 2025-07-17 13:55:43 +02:00
parent b8bd5ed478
commit 73faa78f1f
8 changed files with 11 additions and 35 deletions

View File

@ -34,13 +34,13 @@ sub set_counters {
$self->{maps_counters}->{global} = [
{
label => 'connections',
label => 'total-connections',
nlabel => 'connections.total.count',
set => {
key_values => [ { name => 'fwConnNumber' } ],
output_template => 'Total connections : %s',
perfdatas => [
{ label => 'connections', template => '%s', unit => 'con', min => 0 },
{ label => 'total_connections', template => '%s', unit => 'con', min => 0 },
],
}
},
@ -134,14 +134,14 @@ Check firewall connections.
=item B<--filter-counters>
Only display some counters (regexp can be used).
Can be : connections, new-connections-sec, discarded-connections-sec, refused-connections-sec
Example : --filter-counters='^connections$'
Can be : total-connections, new-connections-sec, discarded-connections-sec, refused-connections-sec
Example : --filter-counters='^total-connections$'
=item B<--warning-connections>
=item B<--warning-total-connections>
Threshold in con.
=item B<--critical-connections>
=item B<--critical-total-connections>
Threshold in con.

View File

@ -25,9 +25,9 @@ Connections ${tc}
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: Total connections : 41, New Connections : 0.00 /s, Discarded Connections : 0.00 /s, Refused Connections : 0.00 /s | 'connections'=41con;;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;;0;
... 1 ${EMPTY} OK: Total connections : 41, New Connections : 0.00 /s, Discarded Connections : 0.00 /s, Refused Connections : 0.00 /s | 'total_connections'=41con;;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;;0;
... 2 --filter-counters=discarded-connections-sec OK: Discarded Connections : 0.00 /s | 'discarded_connections'=0.00con/s;;;0;
... 3 --warning-connections=:1 WARNING: Total connections : 41 | 'connections'=41con;0:1;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;;0;
... 4 --critical-discarded-connections-sec=1: CRITICAL: Discarded Connections : 0.00 /s | 'connections'=41con;;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;1:;0; 'refused_connections'=0.00con/s;;;0;
... 5 --warning-new-connections-sec=1: WARNING: New Connections : 0.00 /s | 'connections'=41con;;;0; 'new_connections'=0.00con/s;1:;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;;0;
... 6 --critical-refused-connections-sec=1: CRITICAL: Refused Connections : 0.00 /s | 'connections'=41con;;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;1:;0;
... 3 --warning-total-connections=:1 WARNING: Total connections : 41 | 'total_connections'=41con;0:1;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;;0;
... 4 --critical-discarded-connections-sec=1: CRITICAL: Discarded Connections : 0.00 /s | 'total_connections'=41con;;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;1:;0; 'refused_connections'=0.00con/s;;;0;
... 5 --warning-new-connections-sec=1: WARNING: New Connections : 0.00 /s | 'total_connections'=41con;;;0; 'new_connections'=0.00con/s;1:;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;;0;
... 6 --critical-refused-connections-sec=1: CRITICAL: Refused Connections : 0.00 /s | 'total_connections'=41con;;;0; 'new_connections'=0.00con/s;;;0; 'discarded_connections'=0.00con/s;;;0; 'refused_connections'=0.00con/s;;1:;0;

View File

@ -1 +0,0 @@
.1.3.6.1.4.1.47565.1.1.1.19.4.0 = INTEGER: 3

View File

@ -1,2 +0,0 @@
.1.3.6.1.4.1.47565.1.1.1.19.2.0 = INTEGER: 2
.1.3.6.1.4.1.47565.1.1.1.19.3.0 = INTEGER: 9

View File

@ -1,4 +0,0 @@
.1.3.6.1.4.1.47565.1.1.1.4.0 = Counter64: 41
.1.3.6.1.4.1.47565.1.1.1.11.4.0 = Counter64: 0
.1.3.6.1.4.1.47565.1.1.1.11.5.0 = Counter64: 0
.1.3.6.1.4.1.47565.1.1.1.11.6.0 = Counter64: 0

View File

@ -1,15 +0,0 @@
.1.3.6.1.4.1.47565.1.1.1.11.3.1.2.1 = STRING: "/dev/XXXX/disc0/XXXX"
.1.3.6.1.4.1.47565.1.1.1.11.3.1.2.2 = STRING: "/dev/xxx8"
.1.3.6.1.4.1.47565.1.1.1.11.3.1.2.3 = STRING: "/dev/xxx9"
.1.3.6.1.4.1.47565.1.1.1.11.3.1.3.1 = STRING: "/"
.1.3.6.1.4.1.47565.1.1.1.11.3.1.3.2 = STRING: "/xxxx"
.1.3.6.1.4.1.47565.1.1.1.11.3.1.3.3 = STRING: "/xxxX"
.1.3.6.1.4.1.47565.1.1.1.11.3.1.4.1 = Counter64: 484992
.1.3.6.1.4.1.47565.1.1.1.11.3.1.4.2 = Counter64: 1980080
.1.3.6.1.4.1.47565.1.1.1.11.3.1.4.3 = Counter64: 3286984
.1.3.6.1.4.1.47565.1.1.1.11.3.1.5.1 = Counter64: 484992
.1.3.6.1.4.1.47565.1.1.1.11.3.1.5.2 = Counter64: 236900
.1.3.6.1.4.1.47565.1.1.1.11.3.1.5.3 = Counter64: 406892
.1.3.6.1.4.1.47565.1.1.1.11.3.1.6.1 = Counter64: 0
.1.3.6.1.4.1.47565.1.1.1.11.3.1.6.2 = Counter64: 1743180
.1.3.6.1.4.1.47565.1.1.1.11.3.1.6.3 = Counter64: 2880092

View File

@ -1 +0,0 @@
.1.3.6.1.4.1.47565.1.1.1.6.0 = Counter64: 21450

View File

@ -1 +0,0 @@
.1.3.6.1.4.1.47565.1.1.1.9.0 = Counter64: 0