centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
312 stars 275 forks source link

[cloud::outscale::plugin] mode load-balancers #4465

Closed ritouret closed 1 year ago

ritouret commented 1 year ago

Hello,

Here is the curl OUTPUT when a VM is DOWN in a load balancer : { "ResponseContext": { "RequestId": "4a591f66-a6f2-468a-a16d-2544753b62b4" }, "BackendVmHealth": [ { "VmId": "i-0f42726d", "State": "UP" }, { "VmId": "i-aa6ae762", "State": "UP" }, { "VmId": "i-7d00e26f", "State": "UP" }, { "VmId": "i-47b216c6", "State": "UP" }, { "VmId": "i-f6d0c97e", "StateReason": "INSTANCE", "State": "DOWN", "Description": "" } ] }

In this case, here is the output with the mode : UNKNOWN: Command error: Traceback (most recent call last): - File "/var/lib/centreon-engine/.venv/bin/osc-cli", line 11, in - sys.exit(main()) - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 785, in main - fire.Fire(api_connect) - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/fire/core.py", line 141, in Fire - component_trace = _Fire(component, args, parsed_flag_args, context, name) - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/fire/core.py", line 480, in _Fire - target=component.name) - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace - component = fn(*varargs, kwargs) - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 766, in api_connect - handler.make_request(call, kwargs) - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 571, in make_request - verify=self.ssl_verify, - File "/var/lib/centreon-engine/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 502, in get_response - raise OscApiException(http_response) - osc_sdk.sdk.OscApiException: Error --> status = 400, code = 5063, code_type = InvalidResource, Reason = The VmId '{id}' doesn't exist., request_id = ff035f69-41f6-408e-9bc1-f52292b864d1

An other case with same error is when VM have been deleted but not the load-balancer. We should have a dedicated error message in OUTPUT if VMs state are not found a load-balancer.

garnier-quentin commented 1 year ago

It's an issue with outscale load-balancers api. So plugin works as expected