Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests/os/aix/snmp/cpu.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Suite Setup Ctn Generic Suite Setup
Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin


*** Test Cases ***
cpu ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=cpu
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 --verbose OK: 8 CPU(s) average usage is 17.50 % | 'total_cpu_avg'=17.50%;;;0;100 'cpu_0'=91.00%;;;0;100 'cpu_1'=22.00%;;;0;100 'cpu_2'=13.00%;;;0;100 'cpu_3'=6.00%;;;0;100 'cpu_4'=0.00%;;;0;100 'cpu_5'=1.00%;;;0;100 'cpu_6'=6.00%;;;0;100 'cpu_7'=1.00%;;;0;100 CPU '0' usage : 91.00 % CPU '1' usage : 22.00 % CPU '2' usage : 13.00 % CPU '3' usage : 6.00 % CPU '4' usage : 0.00 % CPU '5' usage : 1.00 % CPU '6' usage : 6.00 % CPU '7' usage : 1.00 %
... 2 --warning-average=3 --critical-average=5 CRITICAL: 8 CPU(s) average usage is 17.50 % | 'total_cpu_avg'=17.50%;0:3;0:5;0;100 'cpu_0'=91.00%;;;0;100 'cpu_1'=22.00%;;;0;100 'cpu_2'=13.00%;;;0;100 'cpu_3'=6.00%;;;0;100 'cpu_4'=0.00%;;;0;100 'cpu_5'=1.00%;;;0;100 'cpu_6'=6.00%;;;0;100 'cpu_7'=1.00%;;;0;100
... 3 --warning-core=5 WARNING: CPU '0' usage : 91.00 % - CPU '1' usage : 22.00 % - CPU '2' usage : 13.00 % - CPU '3' usage : 6.00 % - CPU '6' usage : 6.00 % | 'total_cpu_avg'=17.50%;;;0;100 'cpu_0'=91.00%;0:5;;0;100 'cpu_1'=22.00%;0:5;;0;100 'cpu_2'=13.00%;0:5;;0;100 'cpu_3'=6.00%;0:5;;0;100 'cpu_4'=0.00%;0:5;;0;100 'cpu_5'=1.00%;0:5;;0;100 'cpu_6'=6.00%;0:5;;0;100 'cpu_7'=1.00%;0:5;;0;100
... 4 --warning-core=3 --critical-core=5 CRITICAL: CPU '0' usage : 91.00 % - CPU '1' usage : 22.00 % - CPU '2' usage : 13.00 % - CPU '3' usage : 6.00 % - CPU '6' usage : 6.00 % | 'total_cpu_avg'=17.50%;;;0;100 'cpu_0'=91.00%;0:3;0:5;0;100 'cpu_1'=22.00%;0:3;0:5;0;100 'cpu_2'=13.00%;0:3;0:5;0;100 'cpu_3'=6.00%;0:3;0:5;0;100 'cpu_4'=0.00%;0:3;0:5;0;100 'cpu_5'=1.00%;0:3;0:5;0;100 'cpu_6'=6.00%;0:3;0:5;0;100 'cpu_7'=1.00%;0:3;0:5;0;100
35 changes: 35 additions & 0 deletions tests/os/aix/snmp/interfaces.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Suite Setup Ctn Generic Suite Setup
Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin


*** Test Cases ***
interfaces ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=5
... ${extra_options}

# first run to build cache
Run ${command}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 ${EMPTY} OK: Interface 'en0' Status : up (admin: up)
... 2 --warning-status='\\\%{admstatus}' WARNING: Interface 'en0' Status : up (admin: up)
... 3 --critical-status='\\\%{admstatus}' CRITICAL: Interface 'en0' Status : up (admin: up)
... 4 --display-transform-src='en0' --display-transform-dst='test' OK: Interface 'test' Status : up (admin: up)
... 5 --interface=1 OK: Interface 'en0' Status : up (admin: up)
30 changes: 30 additions & 0 deletions tests/os/aix/snmp/list-interfaces.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Suite Setup Ctn Generic Suite Setup
Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin


*** Test Cases ***
list-interfaces ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=list-interfaces
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 ${EMPTY} List interfaces: 'en0' [speed = 1500][status = up][id = 1][type = ethernetCsmacd]
... 2 --name='en0' List interfaces: 'en0' [speed = 1500][status = up][id = 1][type = ethernetCsmacd]
... 3 --display-transform-src='en0' --display-transform-dst='test' List interfaces: 'test' [speed = 1500][status = up][id = 1][type = ethernetCsmacd]
29 changes: 29 additions & 0 deletions tests/os/aix/snmp/list-processes.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Suite Setup Ctn Generic Suite Setup
Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin


*** Test Cases ***
list-processes ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=list-processes
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 --filter-name='Anonymized 136' List processes: [name = Anonymized 136] [path = Anonymized 008] [parameters = ] [type = deviceDriver] [pid = 5] [status = notRunnable]
... 2 --add-stats --filter-name='Anonymized 129' List processes: [name = Anonymized 129] [path = /usr/lib/drivers/vdev_busdd] [parameters = ] [type = deviceDriver] [pid = 47] [status = notRunnable] [cpu = 0] [mem = 0]
29 changes: 29 additions & 0 deletions tests/os/aix/snmp/list-storages.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Suite Setup Ctn Generic Suite Setup
Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin


*** Test Cases ***
list-storages ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=list-storages
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 --verbose --storage=1 List storage: '/dev/hd4' [size = 1073741824B] [id = 1]
... 2 --display-transform-src='Anonymized 205' --display-transform-dst='test' List storage: '/dev/hd4' [size = 1073741824B] [id = 1] '/dev/lv_logiciel' [size = 212600881152B] [id = 10] '/dev/lv_statsnmon' [size = 1073741824B] [id = 11] '/dev/lv_exp0x00' [size = 536870912B] [id = 12] '/dev/lv_oradiag' [size = 4294967296B] [id = 13] '/dev/lvrubrik' [size = 268435456B] [id = 14] '/dev/lv_automx01' [size = 1073741824B] [id = 15] '/dev/lvorar1DJET4' [size = 4294967296B] [id = 16] '/dev/lvorar2DJET4' [size = 4294967296B] [id = 17] '/dev/lvorafraDJET4' [size = 53687091200B] [id = 18] '/dev/lvoradbDJET4' [size = 429496729600B] [id = 19] '/dev/hd2' [size = 5368709120B] [id = 2] '/dev/lvoradpDJET4' [size = 805306368B] [id = 20] '/dev/lv_automx02' [size = 2147483648B] [id = 21] Skipping storage '/dev/hd6': no type or no matching filter type Skipping storage 'test': no type or no matching filter type '/dev/hd9var' [size = 1140850688B] [id = 3] '/dev/hd3' [size = 2147483648B] [id = 4] '/dev/hd1' [size = 603979776B] [id = 5] '/dev/hd11admin' [size = 134217728B] [id = 6] '/dev/hd10opt' [size = 4966055936B] [id = 7] '/dev/livedump' [size = 268435456B] [id = 8] '/dev/lv_automx00' [size = 1073741824B] [id = 9]
40 changes: 40 additions & 0 deletions tests/os/aix/snmp/processcount.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*** Settings ***
Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource

Suite Setup Ctn Generic Suite Setup
Test Timeout 120s


*** Variables ***
${CMD} ${CENTREON_PLUGINS} --plugin=os::aix::snmp::plugin


*** Test Cases ***
processcount ${tc}
[Tags] os aix
${command} Catenate
... ${CMD}
... --mode=processcount
... --hostname=${HOSTNAME}
... --snmp-version=${SNMPVERSION}
... --snmp-port=${SNMPPORT}
... --snmp-community=os/aix/snmp/slim_os-aix
... --snmp-timeout=1
... ${extra_options}

Ctn Run Command And Check Result As Strings ${command} ${expected_result}

Examples: tc extra_options expected_result --
... 1 ${EMPTY} --top OK: Number of current processes running: 131 | 'nbproc'=131;;;0; 'top_'=375496704B;;;0;
... 2 --process-status='running|runnable' OK: Number of current processes running: 131 | 'nbproc'=131;;;0;
... 3 --process-name=85 OK: Number of current processes running: 0 | 'nbproc'=0;;;0;
... 4 --process-args OK: Number of current processes running: 131 | 'nbproc'=131;;;0;
... 5 --warning=5 WARNING: Number of current processes running: 131 | 'nbproc'=131;0:5;;0;
... 6 --critical=8 CRITICAL: Number of current processes running: 131 | 'nbproc'=131;;0:8;0;
... 7 --memory OK: Number of current processes running: 131 - Total memory usage: 452.86 MB - Average memory usage: 3.46 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;;0; 'mem_avg'=3624866.20B;;;0;
... 8 --warning-mem-total=5 --memory WARNING: Total memory usage: 452.86 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;0:5;;0; 'mem_avg'=3624866.20B;;;0;
... 9 --critical-mem-total=4 --memory CRITICAL: Total memory usage: 452.86 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;0:4;0; 'mem_avg'=3624866.20B;;;0;
... 10 --warning-mem-avg=3 --memory WARNING: Average memory usage: 3.46 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;;0; 'mem_avg'=3624866.20B;0:3;;0;
... 11 --critical-mem-avg=3 --memory CRITICAL: Average memory usage: 3.46 MB | 'nbproc'=131;;;0; 'mem_total'=474857472B;;;0; 'mem_avg'=3624866.20B;;0:3;0;
... 12 --warning-cpu-total=10 --cpu OK: Number of current processes running: 131 | 'nbproc'=131;;;0;
... 13 --critical-cpu-total=5 --cpu OK: Number of current processes running: 131 - Total CPU usage: 0.00 % | 'nbproc'=131;;;0; 'cpu_total'=0.00%;;0:5;0;
Loading