enix / hpmsa_exporter

Prometheus exporter for HP MSA storage SAN
https://enix.io
MIT License
23 stars 13 forks source link

Unauthorized error over time #4

Closed andbuitra closed 1 year ago

andbuitra commented 3 years ago

Hello,

After around a week of use the exporter shows an "Unauthorized" error when trying to scrape the API. Nothing has changed since deployment and it doesn't look like there's some blacklist. The user has had "Monitoring" rights all the time and can get logged through SMU.

ene 21 20:50:16 monitor2-co systemd[1]: Started HP MSA Exporter.
ene 21 20:50:17 monitor2-co msa_exporter.py[14119]: /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:851: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
ene 21 20:50:17 monitor2-co msa_exporter.py[14119]: InsecureRequestWarning)
ene 21 20:50:17 monitor2-co msa_exporter.py[14119]: /usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py:851: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
ene 21 20:50:17 monitor msa_exporter.py[14119]: InsecureRequestWarning)
ene 21 20:50:17 monitor msa_exporter.py[14119]: Traceback (most recent call last):
ene 21 20:50:17 monitor msa_exporter.py[14119]: File "/root/prometheus-monitoring/hpmsa_exporter/msa_exporter.py", line 856, in <module>
ene 21 20:50:17 monitor msa_exporter.py[14119]: scrap_msa(metrics_store, args.hostname, args.login, args.password)
ene 21 20:50:17 monitor msa_exporter.py[14119]: File "/root/prometheus-monitoring/hpmsa_exporter/msa_exporter.py", line 829, in scrap_msa
ene 21 20:50:17 monitor msa_exporter.py[14119]: response.raise_for_status()
ene 21 20:50:17 monitor msa_exporter.py[14119]: File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
ene 21 20:50:17 monitor msa_exporter.py[14119]: raise HTTPError(http_error_msg, response=self)
ene 21 20:50:17 monitor msa_exporter.py[14119]: requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://[REDACTED]/api/show/host-port-statistics
ene 21 20:50:17 monitor systemd[1]: hpmsa_exporter.service: main process exited, code=exited, status=1/FAILURE
ene 21 20:50:17 monitor systemd[1]: Unit hpmsa_exporter.service entered failed state.
ene 21 20:50:17 monitoo systemd[1]: hpmsa_exporter.service failed

This is being done on an MSA 2050.

lcaflc commented 1 year ago

Auth is now switched to sha256. will see if this change. Auth is also done at each scrape loop, so auth timeout should not be an issue.