diff --git a/src/hardware/ups/standard/rfc1628/snmp/plugin.pm b/src/hardware/ups/standard/rfc1628/snmp/plugin.pm index bcaeb5cf3..a42a182c0 100644 --- a/src/hardware/ups/standard/rfc1628/snmp/plugin.pm +++ b/src/hardware/ups/standard/rfc1628/snmp/plugin.pm @@ -16,7 +16,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# + package hardware::ups::standard::rfc1628::snmp::plugin; diff --git a/src/snmp_standard/mode/udpcon.pm b/src/snmp_standard/mode/udpcon.pm index ddbd552f0..0e8b7a6b9 100644 --- a/src/snmp_standard/mode/udpcon.pm +++ b/src/snmp_standard/mode/udpcon.pm @@ -301,7 +301,7 @@ __END__ =head1 MODE -Check udp connections. +Check UDP connections. =over 8 @@ -315,7 +315,7 @@ Critical threshold for total connections. =item B<--service> -Check udp connections following rules: +Check UDP connections following rules: tag,[type],[port],[filter-ip],[threshold-warning],[threshold-critical] Example to test NTP connections on the server: --service="ntp,,123,1,2" @@ -342,7 +342,7 @@ nagios-perfdata - number of connections. =item B<--application> -Check udp connections of mutiple services: +Check UDP connections of multiple services: tag,[services],[threshold-warning],[threshold-critical] Example: diff --git a/tests/os/linux/snmp/load.robot b/tests/os/linux/snmp/load.robot index 029dfa1fd..d5ff077ca 100644 --- a/tests/os/linux/snmp/load.robot +++ b/tests/os/linux/snmp/load.robot @@ -21,14 +21,13 @@ load ${tc} ... --snmp-port=${SNMPPORT} ... --snmp-community=os/linux/snmp/linux ... --snmp-timeout=1 - ... ${extra_options} + ... --critical=${critical} + ... --warning=${warning} + ... --average=${average} Ctn Run Command And Check Result As Strings ${command} ${expected_result} - Examples: tc extra_options expected_result -- - ... 1 --critical=15 OK: Load average: 0.87, 0.63, 0.47 | 'load1'=0.87;;0:15;0; 'load5'=0.63;;;0; 'load15'=0.47;;;0; - ... 2 --critical='2' OK: Load average: 0.87, 0.63, 0.47 | 'load1'=0.87;;0:2;0; 'load5'=0.63;;;0; 'load15'=0.47;;;0; - ... 3 --warning='1' OK: Load average: 0.87, 0.63, 0.47 | 'load1'=0.87;0:1;;0; 'load5'=0.63;;;0; 'load15'=0.47;;;0; - ... 4 --critical='0' CRITICAL: Load average: 0.87, 0.63, 0.47 | 'load1'=0.87;;0:0;0; 'load5'=0.63;;;0; 'load15'=0.47;;;0; - ... 5 --warning='3' OK: Load average: 0.87, 0.63, 0.47 | 'load1'=0.87;0:3;;0; 'load5'=0.63;;;0; 'load15'=0.47;;;0; - ... 6 --average='0.87' OK: Load average: 0.43 [0.87/2 CPUs], 0.32 [0.63/2 CPUs], 0.23 [0.47/2 CPUs] | 'avg_load1'=0.43;;;0; 'avg_load5'=0.32;;;0; 'avg_load15'=0.23;;;0; 'load1'=0.87;;;0; 'load5'=0.63;;;0; 'load15'=0.47;;;0; + Examples: tc critical warning average expected_result -- + ... 1 '6,5,4' '4,3,2' ${EMPTY} OK: Load average: 0.43 [0.87/2 CPUs], 0.32 [0.63/2 CPUs], 0.23 [0.47/2 CPUs] | 'avg_load1'=0.43;0:4;0:6;0; 'avg_load5'=0.32;0:3;0:5;0; 'avg_load15'=0.23;0:2;0:4;0; 'load1'=0.87;0:8;0:12;0; 'load5'=0.63;0:6;0:10;0; 'load15'=0.47;0:4;0:8;0; + ... 2 '0,0,0' '4,3,2' ${EMPTY} CRITICAL: Load average: 0.43 [0.87/2 CPUs], 0.32 [0.63/2 CPUs], 0.23 [0.47/2 CPUs] | 'avg_load1'=0.43;0:4;0:0;0; 'avg_load5'=0.32;0:3;0:0;0; 'avg_load15'=0.23;0:2;0:0;0; 'load1'=0.87;0:8;0:0;0; 'load5'=0.63;0:6;0:0;0; 'load15'=0.47;0:4;0:0;0; + ... 3 '600,500,100' '0,0,0' ${EMPTY} WARNING: Load average: 0.43 [0.87/2 CPUs], 0.32 [0.63/2 CPUs], 0.23 [0.47/2 CPUs] | 'avg_load1'=0.43;0:0;0:600;0; 'avg_load5'=0.32;0:0;0:500;0; 'avg_load15'=0.23;0:0;0:100;0; 'load1'=0.87;0:0;0:1200;0; 'load5'=0.63;0:0;0:1000;0; 'load15'=0.47;0:0;0:200;0; diff --git a/tests/os/linux/snmp/swap.robot b/tests/os/linux/snmp/swap.robot index 9d106647a..af3c5b564 100644 --- a/tests/os/linux/snmp/swap.robot +++ b/tests/os/linux/snmp/swap.robot @@ -19,18 +19,21 @@ swap ${tc} ... --hostname=${HOSTNAME} ... --snmp-version=${SNMPVERSION} ... --snmp-port=${SNMPPORT} - ... --snmp-community=os/linux/snmp/linux + ... --snmp-community=os/linux/snmp/swap ... --snmp-timeout=1 - ... ${extra_options} + ... --no-swap=${no-swap} + ... --warning-usage=${warning-usage} + ... --warning-usage-free=${warning-usage-free} + ... --warning-usage-prct=${warning-usage-prct} + ... --critical-usage=${critical-usage} + ... --critical-usage-free=${critical-usage-free} + ... --critical-usage-prct=${critical-usage-prct} Ctn Run Command And Check Result As Strings ${command} ${expected_result} - Examples: tc extra_options expected_result -- - ... 1 --verbose CRITICAL: No active swap - ... 2 --no-swap CRITICAL: No active swap - ... 3 --warning-usage='2' CRITICAL: No active swap - ... 4 --warning-usage-free='' CRITICAL: No active swap - ... 5 --warning-usage-prct='' CRITICAL: No active swap - ... 6 --critical-usage='' CRITICAL: No active swap - ... 7 --critical-usage-free='' CRITICAL: No active swap - ... 8 --critical-usage-prct='' CRITICAL: No active swap + Examples: tc no-swap warning-usage warning-usage-free warning-usage-prct critical-usage critical-usage-free critical-usage-prct expected_result -- + ... 1 ${EMPTY} ${EMPTY} ${EMPTY} '10' ${EMPTY} ${EMPTY} '30' OK: Swap Total: 976.00 MB Used: 0.00 B (0.00%) Free: 976.00 MB (100.00%) | 'used'=0B;;;0;1023406080 'free'=1023406080B;;;0;1023406080 'used_prct'=0.00%;0:10;0:30;0;100 + ... 2 '' ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: Swap Total: 976.00 MB Used: 0.00 B (0.00%) Free: 976.00 MB (100.00%) | 'used'=0B;;;0;1023406080 'free'=1023406080B;;;0;1023406080 'used_prct'=0.00%;;;0;100 + ... 3 ${EMPTY} ${EMPTY} '10' ${EMPTY} ${EMPTY} '30' ${EMPTY} CRITICAL: Swap Total: 976.00 MB Used: 0.00 B (0.00%) Free: 976.00 MB (100.00%) | 'used'=0B;;;0;1023406080 'free'=1023406080B;0:10;0:30;0;1023406080 'used_prct'=0.00%;;;0;100 + ... 4 ${EMPTY} '100' ${EMPTY} ${EMPTY} '100' ${EMPTY} ${EMPTY} OK: Swap Total: 976.00 MB Used: 0.00 B (0.00%) Free: 976.00 MB (100.00%) | 'used'=0B;0:100;0:100;0;1023406080 'free'=1023406080B;;;0;1023406080 'used_prct'=0.00%;;;0;100 + ... 5 ${EMPTY} ${EMPTY} '100' ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Swap Total: 976.00 MB Used: 0.00 B (0.00%) Free: 976.00 MB (100.00%) | 'used'=0B;;;0;1023406080 'free'=1023406080B;0:100;;0;1023406080 'used_prct'=0.00%;;;0;100 \ No newline at end of file diff --git a/tests/os/linux/snmp/swap.snmpwalk b/tests/os/linux/snmp/swap.snmpwalk new file mode 100644 index 000000000..31fe7084c --- /dev/null +++ b/tests/os/linux/snmp/swap.snmpwalk @@ -0,0 +1,23 @@ +.1.3.6.1.4.1.2021.4.1.0 = INTEGER: 0 +.1.3.6.1.4.1.2021.4.2.0 = STRING: swap +.1.3.6.1.4.1.2021.4.3.0 = INTEGER: 999420 +.1.3.6.1.4.1.2021.4.4.0 = INTEGER: 999420 +.1.3.6.1.4.1.2021.4.5.0 = INTEGER: 15221360 +.1.3.6.1.4.1.2021.4.6.0 = INTEGER: 6752940 +.1.3.6.1.4.1.2021.4.11.0 = INTEGER: 7752360 +.1.3.6.1.4.1.2021.4.12.0 = INTEGER: 16000 +.1.3.6.1.4.1.2021.4.13.0 = INTEGER: 314012 +.1.3.6.1.4.1.2021.4.14.0 = INTEGER: 259672 +.1.3.6.1.4.1.2021.4.15.0 = INTEGER: 3703232 +.1.3.6.1.4.1.2021.4.18.0 = Counter64: 999420 +.1.3.6.1.4.1.2021.4.19.0 = Counter64: 999420 +.1.3.6.1.4.1.2021.4.20.0 = Counter64: 15221360 +.1.3.6.1.4.1.2021.4.21.0 = Counter64: 6752940 +.1.3.6.1.4.1.2021.4.22.0 = Counter64: 7752360 +.1.3.6.1.4.1.2021.4.23.0 = Counter64: 16000 +.1.3.6.1.4.1.2021.4.24.0 = Counter64: 314012 +.1.3.6.1.4.1.2021.4.25.0 = Counter64: 259672 +.1.3.6.1.4.1.2021.4.26.0 = Counter64: 3703232 +.1.3.6.1.4.1.2021.4.27.0 = Counter64: 10068492 +.1.3.6.1.4.1.2021.4.100.0 = INTEGER: 0 +.1.3.6.1.4.1.2021.4.101.0 = STRING: \ No newline at end of file diff --git a/tests/os/linux/snmp/time.robot b/tests/os/linux/snmp/time.robot index 9f53eb6d4..a507368ad 100644 --- a/tests/os/linux/snmp/time.robot +++ b/tests/os/linux/snmp/time.robot @@ -1,6 +1,5 @@ *** Settings *** Documentation Check time table - Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource Test Timeout 120s @@ -22,14 +21,14 @@ time ${tc} ... --snmp-community=os/linux/snmp/linux ... --snmp-timeout=1 ... ${extra_options} - + ${output} Run ${command} ${output} Strip String ${output} Should Match Regexp ${output} ${expected_result} Examples: tc extra_options expected_result -- - ... 1 --oid='' ^(OK|WARNING|CRITICAL): Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ - ... 2 --warning-offset='0' ^(OK|WARNING|CRITICAL): Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ - ... 3 --critical-offset='125' ^(OK|WARNING|CRITICAL): Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ - ... 4 --ntp-port=123 ^(OK|WARNING|CRITICAL): Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ - ... 5 --timezone='+0100' ^(OK|WARNING|CRITICAL): Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ + ... 1 --oid='' OK: Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ + ... 2 --warning-offset='0' WARNING: Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ + ... 3 --critical-offset='125' CRITICAL: Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ + ... 4 --ntp-port=123 OK: Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ + ... 5 --timezone='+0100' OK: Time offset (-?\\\\d+) second\\\\(s\\\\): Local Time : (\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}) \\\\(\\\\+\\\\d{4}\\\\) \\\\| 'offset'=(-?\\\\d+)s;.*$ \ No newline at end of file diff --git a/tests/resources/spellcheck/stopwords.txt b/tests/resources/spellcheck/stopwords.txt index c90e5ef7a..627312e47 100644 --- a/tests/resources/spellcheck/stopwords.txt +++ b/tests/resources/spellcheck/stopwords.txt @@ -43,6 +43,7 @@ --noeventlog --nomachineaccount --ntlmv2 +--oid --oid-display --oid-extra-display --oid-filter @@ -139,11 +140,17 @@ in-bcast in-mcast in-ucast interface-dsl-name +ipv4 +ipv6 jobqueue jobqueues keepass +Kubernetes ldap license-instances-usage-prct +multiple +NTP +nagios okta oneaccess-sys-mib out-bcast @@ -168,6 +175,7 @@ total-online-prct total-oper-down total-oper-up tower-cli +UDP uptime usage-prct userpass @@ -178,11 +186,4 @@ Veeam VeloCloud VMware WSMAN -Kubernetes -NTP -ipv4 -ipv6 -mutiple -nagios -udp -oid \ No newline at end of file +