mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
refactor
This commit is contained in:
parent
e7a77ae09f
commit
63ad4716b7
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
log.html
|
log.html
|
||||||
output.xml
|
output.xml
|
||||||
report.html
|
report.html
|
||||||
|
|
||||||
|
.github/docker/testing/Dockerfile.local-tests
|
@ -382,7 +382,6 @@ Network Fortinet Fortigate SNMP link monitor
|
|||||||
... ${command}
|
... ${command}
|
||||||
... --critical-packet-loss=${fortinet_fortigate_linkmonitor_test.criticalpacketloss}
|
... --critical-packet-loss=${fortinet_fortigate_linkmonitor_test.criticalpacketloss}
|
||||||
END
|
END
|
||||||
Log To Console . no_newline=true
|
|
||||||
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_linkmonitor_test.result}
|
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_linkmonitor_test.result}
|
||||||
END
|
END
|
||||||
|
|
||||||
@ -415,6 +414,5 @@ Network Fortinet Fortigate SNMP list link monitor
|
|||||||
... ${command}
|
... ${command}
|
||||||
... --filter-vdom=${fortinet_fortigate_listlinkmonitors_test.filtervdom}
|
... --filter-vdom=${fortinet_fortigate_listlinkmonitors_test.filtervdom}
|
||||||
END
|
END
|
||||||
Log To Console . no_newline=true
|
|
||||||
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_listlinkmonitors_test.result}
|
Ctn Run Command And Check Result As Strings ${command} ${fortinet_fortigate_listlinkmonitors_test.result}
|
||||||
END
|
END
|
||||||
|
@ -33,17 +33,10 @@ Cells radio ${tc}
|
|||||||
... --warning-module-cellradio-snr=${warningmodulecellradiosnr}
|
... --warning-module-cellradio-snr=${warningmodulecellradiosnr}
|
||||||
... --critical-module-cellradio-snr=${criticalmodulecellradiosnr}
|
... --critical-module-cellradio-snr=${criticalmodulecellradiosnr}
|
||||||
|
|
||||||
${output} Run ${command}
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
${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
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
... 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;
|
... 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;
|
... 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,12 +26,7 @@ Interfaces by id ${tc}/5
|
|||||||
... --interface='${filter}'
|
... --interface='${filter}'
|
||||||
... ${extra_options}
|
... ${extra_options}
|
||||||
|
|
||||||
${output} Run ${command}
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
${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
|
|
||||||
|
|
||||||
Examples: tc filter extra_options expected_result --
|
Examples: tc filter extra_options expected_result --
|
||||||
... 1 1 ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
... 1 1 ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||||
@ -50,12 +45,7 @@ Interfaces by id regexp ${tc}/6
|
|||||||
... --regex-id
|
... --regex-id
|
||||||
... ${extra_options}
|
... ${extra_options}
|
||||||
|
|
||||||
${output} Run ${command}
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
${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
|
|
||||||
|
|
||||||
Examples: tc filter extra_options expected_result --
|
Examples: tc filter extra_options expected_result --
|
||||||
... 1 ^1$ ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
... 1 ^1$ ${EMPTY} OK: Interface 'lo' Status : up (admin: up)
|
||||||
|
@ -15,7 +15,7 @@ ${CMD} ${CENTREON_PLUGINS}
|
|||||||
|
|
||||||
|
|
||||||
*** Test Cases ***
|
*** Test Cases ***
|
||||||
Windows Services EN ${tc}/x
|
Windows Services EN ${tc}
|
||||||
[Documentation] Full ASCII
|
[Documentation] Full ASCII
|
||||||
[Tags] os linux local
|
[Tags] os linux local
|
||||||
${command} Catenate
|
${command} Catenate
|
||||||
@ -24,12 +24,7 @@ Windows Services EN ${tc}/x
|
|||||||
... --filter-name='${filter}'
|
... --filter-name='${filter}'
|
||||||
... ${extra_option}
|
... ${extra_option}
|
||||||
|
|
||||||
${output} Run ${command}
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
${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
|
|
||||||
|
|
||||||
Examples: tc filter extra_option 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;
|
... 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
|
Datacore check pool usage
|
||||||
[Documentation] Check Datacore pool usage
|
[Documentation] Check Datacore pool usage
|
||||||
[Tags] storage api
|
[Tags] storage api
|
||||||
${output} Run
|
${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}
|
... ${CMD}
|
||||||
${output} Strip String ${output}
|
... --mode=pool-usage
|
||||||
Should Be Equal As Strings
|
... --critical-oversubscribed=${critical-oversubscribed}
|
||||||
... ${output}
|
... --warning-oversubscribed=${warning-oversubscribed}
|
||||||
... ${result}
|
... --warning-bytesallocatedpercentage=${warning-bytesallocatedpercentage}
|
||||||
... Wrong output result for pool usage :\n\n ${output} \n\n ${result}\n\n
|
... --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 --
|
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;
|
... 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;
|
... 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
|
Datacore check alert count
|
||||||
[Documentation] Check Datacore pool usage
|
[Documentation] Check Datacore pool usage
|
||||||
[Tags] storage api
|
[Tags] storage api
|
||||||
${output} Run
|
${command} Catenate
|
||||||
... ${CMD} --mode=alerts --warning-error=${warning-error} --critical-error=${critical-error} --warning-warning=${warning-warning} --critical-warning=${critical-warning}
|
... ${CMD}
|
||||||
${output} Strip String ${output}
|
... --mode=alerts
|
||||||
Should Be Equal As Strings
|
... --warning-error=${warning-error}
|
||||||
... ${output}
|
... --critical-error=${critical-error}
|
||||||
... ${result}
|
... --warning-warning=${warning-warning}
|
||||||
... Wrong output result for alert count :\n\n ${output} \n\n ${result}\n\n
|
... --critical-warning=${critical-warning}
|
||||||
|
|
||||||
Examples: warning-error critical-error warning-warning critical-warning result --
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
|
|
||||||
|
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;
|
... 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;
|
... 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
|
Datacore check status monitor
|
||||||
[Documentation] Check Datacore pool usage
|
[Documentation] Check Datacore pool usage
|
||||||
[Tags] storage api
|
[Tags] storage api
|
||||||
${output} Run
|
${command} Catenate
|
||||||
... ${CMD} --mode=status-monitor
|
... ${CMD}
|
||||||
${output} Strip String ${output}
|
... --mode=status-monitor
|
||||||
Should Be Equal As Strings
|
|
||||||
... ${output}
|
|
||||||
... ${result}
|
|
||||||
... Wrong output result for status monitor :\n${output} \nresult:\n${result}\n\n
|
|
||||||
|
|
||||||
Examples: result --
|
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||||
|
|
||||||
|
Examples: expected_result --
|
||||||
... CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
|
... CRITICAL: 'State of HostVM2' status : 'Critical', message is 'Connected'
|
||||||
|
@ -68,11 +68,7 @@ Components
|
|||||||
... --snmp-port=${SNMPPORT}
|
... --snmp-port=${SNMPPORT}
|
||||||
... --snmp-community=${check_components_test.snmpcommunity}
|
... --snmp-community=${check_components_test.snmpcommunity}
|
||||||
|
|
||||||
${output} Run ${command}
|
Ctn Run Command And Check Result As Strings ${command} ${check_components_test.expected_output}
|
||||||
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}
|
|
||||||
END
|
END
|
||||||
|
|
||||||
Uptime
|
Uptime
|
||||||
@ -88,9 +84,5 @@ Uptime
|
|||||||
... --warning-uptime=${test_item.warning}
|
... --warning-uptime=${test_item.warning}
|
||||||
... --critical-uptime=${test_item.critical}
|
... --critical-uptime=${test_item.critical}
|
||||||
|
|
||||||
${output} Run ${command}
|
Ctn Run Command And Check Result As Strings ${command} ${test_item.expected_output}
|
||||||
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}
|
|
||||||
END
|
END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user