From 73faa78f1f73f92d75023b6f112b0592d8131748 Mon Sep 17 00:00:00 2001 From: Sylvain Cresto Date: Thu, 17 Jul 2025 13:55:43 +0200 Subject: [PATCH] Fix after review --- .../forcepoint/sdwan/snmp/mode/connections.pm | 12 ++++++------ .../forcepoint/sdwan/snmp/connections.robot | 10 +++++----- .../sdwan/snmp/forcepoint-clusterload.snmpwalk | 1 - .../sdwan/snmp/forcepoint-clusterstate.snmpwalk | 2 -- .../sdwan/snmp/forcepoint-connections.snmpwalk | 4 ---- .../sdwan/snmp/forcepoint-diskusage.snmpwalk | 15 --------------- .../sdwan/snmp/forcepoint-droppedpackets.snmpwalk | 1 - .../snmp/forcepoint-rejectedpackets.snmpwalk | 1 - 8 files changed, 11 insertions(+), 35 deletions(-) delete mode 100644 tests/network/forcepoint/sdwan/snmp/forcepoint-clusterload.snmpwalk delete mode 100644 tests/network/forcepoint/sdwan/snmp/forcepoint-clusterstate.snmpwalk delete mode 100644 tests/network/forcepoint/sdwan/snmp/forcepoint-connections.snmpwalk delete mode 100644 tests/network/forcepoint/sdwan/snmp/forcepoint-diskusage.snmpwalk delete mode 100644 tests/network/forcepoint/sdwan/snmp/forcepoint-droppedpackets.snmpwalk delete mode 100644 tests/network/forcepoint/sdwan/snmp/forcepoint-rejectedpackets.snmpwalk diff --git a/src/network/forcepoint/sdwan/snmp/mode/connections.pm b/src/network/forcepoint/sdwan/snmp/mode/connections.pm index 39b61b41d..760ffb0f5 100644 --- a/src/network/forcepoint/sdwan/snmp/mode/connections.pm +++ b/src/network/forcepoint/sdwan/snmp/mode/connections.pm @@ -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. diff --git a/tests/network/forcepoint/sdwan/snmp/connections.robot b/tests/network/forcepoint/sdwan/snmp/connections.robot index 35183fe4c..d889be72b 100644 --- a/tests/network/forcepoint/sdwan/snmp/connections.robot +++ b/tests/network/forcepoint/sdwan/snmp/connections.robot @@ -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; diff --git a/tests/network/forcepoint/sdwan/snmp/forcepoint-clusterload.snmpwalk b/tests/network/forcepoint/sdwan/snmp/forcepoint-clusterload.snmpwalk deleted file mode 100644 index 9c4a64093..000000000 --- a/tests/network/forcepoint/sdwan/snmp/forcepoint-clusterload.snmpwalk +++ /dev/null @@ -1 +0,0 @@ -.1.3.6.1.4.1.47565.1.1.1.19.4.0 = INTEGER: 3 diff --git a/tests/network/forcepoint/sdwan/snmp/forcepoint-clusterstate.snmpwalk b/tests/network/forcepoint/sdwan/snmp/forcepoint-clusterstate.snmpwalk deleted file mode 100644 index 32f8b3955..000000000 --- a/tests/network/forcepoint/sdwan/snmp/forcepoint-clusterstate.snmpwalk +++ /dev/null @@ -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 diff --git a/tests/network/forcepoint/sdwan/snmp/forcepoint-connections.snmpwalk b/tests/network/forcepoint/sdwan/snmp/forcepoint-connections.snmpwalk deleted file mode 100644 index 350d222ef..000000000 --- a/tests/network/forcepoint/sdwan/snmp/forcepoint-connections.snmpwalk +++ /dev/null @@ -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 diff --git a/tests/network/forcepoint/sdwan/snmp/forcepoint-diskusage.snmpwalk b/tests/network/forcepoint/sdwan/snmp/forcepoint-diskusage.snmpwalk deleted file mode 100644 index 892dbf05d..000000000 --- a/tests/network/forcepoint/sdwan/snmp/forcepoint-diskusage.snmpwalk +++ /dev/null @@ -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 diff --git a/tests/network/forcepoint/sdwan/snmp/forcepoint-droppedpackets.snmpwalk b/tests/network/forcepoint/sdwan/snmp/forcepoint-droppedpackets.snmpwalk deleted file mode 100644 index ef8615fab..000000000 --- a/tests/network/forcepoint/sdwan/snmp/forcepoint-droppedpackets.snmpwalk +++ /dev/null @@ -1 +0,0 @@ -.1.3.6.1.4.1.47565.1.1.1.6.0 = Counter64: 21450 diff --git a/tests/network/forcepoint/sdwan/snmp/forcepoint-rejectedpackets.snmpwalk b/tests/network/forcepoint/sdwan/snmp/forcepoint-rejectedpackets.snmpwalk deleted file mode 100644 index 7df51be43..000000000 --- a/tests/network/forcepoint/sdwan/snmp/forcepoint-rejectedpackets.snmpwalk +++ /dev/null @@ -1 +0,0 @@ -.1.3.6.1.4.1.47565.1.1.1.9.0 = Counter64: 0