A companion repository for the VMware Validated Solutions for VMware Cloud Foundation.
BSD 2-Clause "Simplified" License
23
stars
5
forks
source link
[HRM] Fix parsing of SOS Version health data for VxRail Manager VM #86
Closed
bhumitra closed 7 months ago
Code of Conduct
VMware Cloud Foundation
v4.5.2
Environment Details
VxRail Testbed
Description
Issue parsing Version Health Data for VxRail Manager.
Expected Behavior
Script should run without errors.
Actual Behavior
[2024-03-25 18:57:51] DEBUG - body has been passed to this api {"stat-content": [{"statKey": "SOS Version Health Summary|area", "timestamps": [1711392868000], "values": ["VXRAILMGR: sfo-m01-vxm01.sfo.rainpole.io"]}, {"statKey": "SOS Version Health Summary|title", "timestamps": [1711392868000], "values": [["7.0.452-28122244"]]}, {"statKey": "SOS Version Health Summary|state", "timestamps": [1711392868000], "values": ["YELLOW"]}, {"statKey": "SOS Version Health Summary|timestamp", "timestamps": [1711392868000], "values": ["Mon Mar 25 18:54:28 2024"]}, {"statKey": "SOS Version Health Summary|message", "timestamps": [1711392868000], "values": ["Warning: Version mismatch found for VXRAILMGR:sfo-m01-vxm01.sfo.rainpole.io. BOM version ['7.0.452-28122244'], Component Running installed version 7.0.452-28152920 and VCF Inventory version 7.0.452-28152920 are not as expected."]}, {"statKey": "SOS Version Health Summary|status", "timestamps": [1711392868000], "values": ["failed"]}, {"statKey": "SOS Version Health Summary|alert", "timestamps": [1711392868000], "values": ["YELLOW"]}, {"statKey": "SOS Version Health Summary|alert_code", "timestamps": [1711392868000], "data": [1]}]} [2024-03-25 18:57:52] DEBUG - https://xint-vrops01.rainpole.io:443 "POST /suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats?_no_links=true HTTP/1.1" 400 None [2024-03-25 18:57:52] DEBUG - Going to call https://xint-vrops01.rainpole.io/suite-api/api/auth/token/acquire [2024-03-25 18:57:52] DEBUG - API URL is /suite-api/api/auth/token/acquire [2024-03-25 18:57:52] DEBUG - body has been passed to this api {"username": "admin", "password": "****"} [2024-03-25 18:57:52] DEBUG - Resetting dropped connection: xint-vrops01.rainpole.io [2024-03-25 18:57:52] DEBUG - https://xint-vrops01.rainpole.io:443 "POST /suite-api/api/auth/token/acquire?_no_links=true HTTP/1.1" 200 None [2024-03-25 18:57:52] DEBUG - https://xint-vrops01.rainpole.io:443 "POST /suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats?_no_links=true HTTP/1.1" 400 None [2024-03-25 18:57:52] ERROR - Error - [send-data-to-vrops.py:41] - Exception occurred. Details - [2024-03-25 18:57:52] ERROR - Traceback (most recent call last): File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 310, in _do_safe_request return self._do_request(url, client_method, params, data, binary, files, api_url, token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 366, in _do_request raise e File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 359, in _do_request raise ClientSideException(result.status_code, result.reason, response_obj) nagini.nagini.ClientSideException: Http error code = 400 Reason = 400. Error object = {'apiErrorCode': 400, 'httpStatusCode': 400, 'message': 'Invalid input format.', 'moreInformation': [{'name': 'api-uri', 'value': '/suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats'}]}
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\vmware\hrm\main\send-data-to-vrops.py", line 38, in inner_function func(*args, *kwargs) File "C:\vmware\hrm\main\send-data-to-vrops.py", line 1706, in push_sddc_versions self.push_data_to_vrops(category, resource_id, hostname, metrics_payload_json) File "C:\vmware\hrm\main\send-data-to-vrops.py", line 373, in push_data_to_vrops self.vrops.add_stats(metrics_payload_json, id=resource_id) File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 399, in
new_method = lambda self, args, **kwargs: self._rest_request(rest_method, params=kwargs, content=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 295, in _rest_request
return self._do_safe_request(templated_url, client_method, encoded_params, data, binary, files, api_url,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 314, in _do_safe_request
return self._do_request(url, client_method, params, data, binary, files, api_url, token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 366, in _do_request
raise e
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 359, in _do_request
raise ClientSideException(result.status_code, result.reason, response_obj)
nagini.nagini.ClientSideException: Http error code = 400
Reason = 400. Error object = {'apiErrorCode': 400,
'httpStatusCode': 400,
'message': 'Invalid input format.',
'moreInformation': [{'name': 'api-uri',
'value': '/suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats'}]}
[2024-03-25 18:57:52] ERROR - Error - [send-data-to-vrops.py:42] - Http error code = 400 Reason = 400. Error object = {'apiErrorCode': 400, 'httpStatusCode': 400, 'message': 'Invalid input format.', 'moreInformation': [{'name': 'api-uri', 'value': '/suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats'}]}
[2024-03-25 18:57:52] ERROR - Traceback (most recent call last): File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 310, in _do_safe_request return self._do_request(url, client_method, params, data, binary, files, api_url, token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 366, in _do_request raise e File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 359, in _do_request raise ClientSideException(result.status_code, result.reason, response_obj) nagini.nagini.ClientSideException: Http error code = 400 Reason = 400. Error object = {'apiErrorCode': 400, 'httpStatusCode': 400, 'message': 'Invalid input format.', 'moreInformation': [{'name': 'api-uri', 'value': '/suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats'}]}
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\vmware\hrm\main\send-data-to-vrops.py", line 38, in inner_function func(*args, *kwargs) File "C:\vmware\hrm\main\send-data-to-vrops.py", line 1706, in push_sddc_versions self.push_data_to_vrops(category, resource_id, hostname, metrics_payload_json) File "C:\vmware\hrm\main\send-data-to-vrops.py", line 373, in push_data_to_vrops self.vrops.add_stats(metrics_payload_json, id=resource_id) File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 399, in
new_method = lambda self, args, **kwargs: self._rest_request(rest_method, params=kwargs, content=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 295, in _rest_request
return self._do_safe_request(templated_url, client_method, encoded_params, data, binary, files, api_url,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 314, in _do_safe_request
return self._do_request(url, client_method, params, data, binary, files, api_url, token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 366, in _do_request
raise e
File "C:\python3\Lib\site-packages\nagini-2.0-py3.12.egg\nagini\nagini.py", line 359, in _do_request
raise ClientSideException(result.status_code, result.reason, response_obj)
nagini.nagini.ClientSideException: Http error code = 400
Reason = 400. Error object = {'apiErrorCode': 400,
'httpStatusCode': 400,
'message': 'Invalid input format.',
'moreInformation': [{'name': 'api-uri',
'value': '/suite-api/api/resources/560220a2-03a0-4b40-bc86-6f35879846ee/stats'}]}
Steps to Reproduce
Run the python script send-data-to-vrops.py in an vxrail environment
Screenshots
No response
References
No response