mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-04-07 20:35:27 +02:00
refactor
This commit is contained in:
parent
e7a77ae09f
commit
63ad4716b7
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
log.html
|
||||
output.xml
|
||||
report.html
|
||||
report.html
|
||||
|
||||
.github/docker/testing/Dockerfile.local-tests
|
@ -382,7 +382,6 @@ Network Fortinet Fortigate SNMP link monitor
|
||||
... ${command}
|
||||
... --critical-packet-loss=${fortinet_fortigate_linkmonitor_test.criticalpacketloss}
|
||||
END
|
||||
Log To Console . no_newline=true
|
||||
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_linkmonitor_test.result}
|
||||
END
|
||||
|
||||
@ -415,6 +414,5 @@ Network Fortinet Fortigate SNMP list link monitor
|
||||
... ${command}
|
||||
... --filter-vdom=${fortinet_fortigate_listlinkmonitors_test.filtervdom}
|
||||
END
|
||||
Log To Console . no_newline=true
|
||||
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_listlinkmonitors_test.result}
|
||||
END
|
||||
|
@ -33,17 +33,10 @@ Cells radio ${tc}
|
||||
... --warning-module-cellradio-snr=${warningmodulecellradiosnr}
|
||||
... --critical-module-cellradio-snr=${criticalmodulecellradiosnr}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for command:\n${command}\n\nObtained:\n${output}\n\nExpected:\n${result}\n
|
||||
... values=False
|
||||
... collapse_spaces=True
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
|
||||
Examples: tc customperfdatainstances criticalstatus warningmodulescellradiodetected criticalmodulescellradiodetected warningmodulecellradiorsrp criticalmodulecellradiorsrp warningmodulecellradiorsrq criticalmodulecellradiorsrq warningmodulecellradiocsq criticalmodulecellradiocsq warningmodulecellradiosnr criticalmodulecellradiosnr result --
|
||||
Examples: tc customperfdatainstances criticalstatus warningmodulescellradiodetected criticalmodulescellradiodetected warningmodulecellradiorsrp criticalmodulecellradiorsrp warningmodulecellradiorsrq criticalmodulecellradiorsrq warningmodulecellradiocsq criticalmodulecellradiocsq warningmodulecellradiosnr criticalmodulecellradiosnr expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: All cellular radio interfaces are ok | 'modules.cellradio.detected.count'=3;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
|
||||
... 4 '%(operator) %(simIcc)' ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} OK: All cellular radio interfaces are ok | 'modules.cellradio.detected.count'=3;;;0; '---~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; '---~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; '---~89330122115801091660#module.cellradio.snr.db'=-1;;;0; '---~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0; 'PHENIX~89330122115801091660#module.cellradio.rsrp.dbm'=-114;;;0; 'PHENIX~89330122115801091660#module.cellradio.rsrq.dbm'=-18;;;0; 'PHENIX~89330122115801091660#module.cellradio.snr.db'=-1;;;0; 'PHENIX~89330122115801091660#module.cellradio.csq.dbm'=-73;;;0;
|
||||
... 5 ${EMPTY} ${EMPTY} 2 ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} ${EMPTY} WARNING: Number of cellular radio interfacesdetected: 3 | 'modules.cellradio.detected.count'=3;0:2;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~control vocal~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~control vocal~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~control vocal~359072066403821#module.cellradio.csq.dbm'=-73;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrp.dbm'=-114;;;0; 'module1~data primary~359072066403821#module.cellradio.rsrq.dbm'=-18;;;0; 'module1~data primary~359072066403821#module.cellradio.snr.db'=-1;;;0; 'module1~data primary~359072066403821#module.cellradio.csq.dbm'=-73;;;0;
|
||||
|
@ -26,15 +26,10 @@ Interfaces by id ${tc}/5
|
||||
... --interface='${filter}'
|
||||
... ${extra_options}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter extra_options expected_result --
|
||||
... 1 1 ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||
Examples: tc filter extra_options expected_result --
|
||||
... 1 1 ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||
... 2 1,3 --add-traffic OK: All interfaces are ok
|
||||
... 3 1,3 --add-traffic OK: All interfaces are ok | 'traffic_in_lo'=0.00b/s;;;0;10000000 'traffic_out_lo'=0.00b/s;;;0;10000000 'traffic_in_eth1'=0.00b/s;;;0;1000000000 'traffic_out_eth1'=0.00b/s;;;0;1000000000
|
||||
... 4 2,3,4 --add-traffic OK: All interfaces are ok
|
||||
@ -50,12 +45,7 @@ Interfaces by id regexp ${tc}/6
|
||||
... --regex-id
|
||||
... ${extra_options}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter extra_options expected_result --
|
||||
... 1 ^1$ ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||
|
@ -15,7 +15,7 @@ ${CMD} ${CENTREON_PLUGINS}
|
||||
|
||||
|
||||
*** Test Cases ***
|
||||
Windows Services EN ${tc}/x
|
||||
Windows Services EN ${tc}
|
||||
[Documentation] Full ASCII
|
||||
[Tags] os linux local
|
||||
${command} Catenate
|
||||
@ -24,12 +24,7 @@ Windows Services EN ${tc}/x
|
||||
... --filter-name='${filter}'
|
||||
... ${extra_option}
|
||||
|
||||
${output} Run ${command}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${expected_result}
|
||||
... \nWrong output result for command:\n${command}\n\nExpected:\n${expected_result}\nCommand output:\n${output}\n\n
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc filter extra_option expected_result --
|
||||
... 1 ${EMPTY} ${EMPTY} OK: All services are ok | 'services.total.count'=168;;;0; 'services.active.count'=168;;;0; 'services.continue.pending.count'=0;;;0; 'services.pause.pending.count'=0;;;0; 'services.paused.count'=0;;;0;
|
||||
|
@ -18,43 +18,46 @@ ${CMD} ${CENTREON_PLUGINS} --plugin=storage::datacore::restapi::plu
|
||||
Datacore check pool usage
|
||||
[Documentation] Check Datacore pool usage
|
||||
[Tags] storage api
|
||||
${output} Run
|
||||
... ${CMD} --mode=pool-usage --critical-oversubscribed=${critical-oversubscribed} --warning-oversubscribed=${warning-oversubscribed} --warning-bytesallocatedpercentage=${warning-bytesallocatedpercentage} --critical-bytesallocatedpercentage=${critical-bytesallocatedpercentage} --pool-id=B5C140F5-6B13-4CAD-AF9D-F7C4172B3A1D:{4dec1b5a-2577-11e5-80c3-00155d651622}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for pool usage :\n\n ${output} \n\n ${result}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=pool-usage
|
||||
... --critical-oversubscribed=${critical-oversubscribed}
|
||||
... --warning-oversubscribed=${warning-oversubscribed}
|
||||
... --warning-bytesallocatedpercentage=${warning-bytesallocatedpercentage}
|
||||
... --critical-bytesallocatedpercentage=${critical-bytesallocatedpercentage}
|
||||
... --pool-id=B5C140F5-6B13-4CAD-AF9D-F7C4172B3A1D:{4dec1b5a-2577-11e5-80c3-00155d651622}
|
||||
|
||||
Examples: warning-bytesallocatedpercentage critical-bytesallocatedpercentage warning-oversubscribed critical-oversubscribed result --
|
||||
... 2 5 -1 3 CRITICAL: Bytes Allocated : 12 % WARNING: Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:2;0:5;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:-1;0:3;0;
|
||||
... 70 80 10 20 OK: Bytes Allocated : 12 % - Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:70;0:80;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:10;0:20;0;
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: warning-bytesallocatedpercentage critical-bytesallocatedpercentage warning-oversubscribed critical-oversubscribed expected_result --
|
||||
... 2 5 -1 3 CRITICAL: Bytes Allocated : 12 % WARNING: Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:2;0:5;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:-1;0:3;0;
|
||||
... 70 80 10 20 OK: Bytes Allocated : 12 % - Over subscribed bytes : 0 | 'datacore.pool.bytesallocated.percentage'=12%;0:70;0:80;0;100 'datacore.pool.oversubscribed.bytes'=0bytes;0:10;0:20;0;
|
||||
|
||||
Datacore check alert count
|
||||
[Documentation] Check Datacore pool usage
|
||||
[Tags] storage api
|
||||
${output} Run
|
||||
... ${CMD} --mode=alerts --warning-error=${warning-error} --critical-error=${critical-error} --warning-warning=${warning-warning} --critical-warning=${critical-warning}
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for alert count :\n\n ${output} \n\n ${result}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=alerts
|
||||
... --warning-error=${warning-error}
|
||||
... --critical-error=${critical-error}
|
||||
... --warning-warning=${warning-warning}
|
||||
... --critical-warning=${critical-warning}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: warning-error critical-error warning-warning critical-warning result --
|
||||
... 0 1 5 5 WARNING: number of error alerts : 1 | 'datacore.event.error.count'=1;0:0;0:1;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
... 5 5 5 5 OK: number of error alerts : 1, number of warning alerts : 1, number of info alerts : 0, number of trace alerts : 0 | 'datacore.event.error.count'=1;0:5;0:5;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
Examples: warning-error critical-error warning-warning critical-warning expected_result --
|
||||
... 0 1 5 5 WARNING: number of error alerts : 1 | 'datacore.event.error.count'=1;0:0;0:1;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
... 5 5 5 5 OK: number of error alerts : 1, number of warning alerts : 1, number of info alerts : 0, number of trace alerts : 0 | 'datacore.event.error.count'=1;0:5;0:5;0; 'datacore.alerts.warning.count'=1;0:5;0:5;0; 'datacore.alerts.info.count'=0;;;0; 'datacore.alerts.trace.count'=0;;;0;
|
||||
|
||||
Datacore check status monitor
|
||||
[Documentation] Check Datacore pool usage
|
||||
[Tags] storage api
|
||||
${output} Run
|
||||
... ${CMD} --mode=status-monitor
|
||||
${output} Strip String ${output}
|
||||
Should Be Equal As Strings
|
||||
... ${output}
|
||||
... ${result}
|
||||
... Wrong output result for status monitor :\n${output} \nresult:\n${result}\n\n
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... --mode=status-monitor
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: result --
|
||||
... CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
|
||||
Examples: expected_result --
|
||||
... CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
|
||||
|
@ -67,12 +67,8 @@ Components
|
||||
... --snmp-version=${SNMPVERSION}
|
||||
... --snmp-port=${SNMPPORT}
|
||||
... --snmp-community=${check_components_test.snmpcommunity}
|
||||
|
||||
${output} Run ${command}
|
||||
Should Be Equal As Strings
|
||||
... ${check_components_test.expected_output}
|
||||
... ${output}
|
||||
... ${check_components_test.description} failed. Wrong output for components mode: ${check_components_test}.{\n}Command output:{\n}${output}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${check_components_test.expected_output}
|
||||
END
|
||||
|
||||
Uptime
|
||||
@ -87,10 +83,6 @@ Uptime
|
||||
... --snmp-community=${test_item.snmpcommunity}
|
||||
... --warning-uptime=${test_item.warning}
|
||||
... --critical-uptime=${test_item.critical}
|
||||
|
||||
${output} Run ${command}
|
||||
Should Be Equal As Strings
|
||||
... ${test_item.expected_output}
|
||||
... ${output}
|
||||
... ${test_item.description} failed. Wrong output for components mode: ${test_item}.{\n}Command output:{\n}${output}
|
||||
|
||||
Ctn Run Command And Check Result As Strings ${command} ${test_item.expected_output}
|
||||
END
|
||||
|
Loading…
x
Reference in New Issue
Block a user