Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_smartdb.json format change #14

Open
RaptahJezus opened this issue Mar 23, 2020 · 3 comments · May be fixed by #15
Open

check_smartdb.json format change #14

RaptahJezus opened this issue Mar 23, 2020 · 3 comments · May be fixed by #15

Comments

@RaptahJezus
Copy link

RaptahJezus commented Mar 23, 2020

Hello,

Commit #78728f8 on the check_smart_attributes repo refactored the check_smartdb.json to be proper json. Following the recommended sudo curl -o /etc/prometheus_smart_exporter/devices.json https://raw.githubusercontent.com/thomas-krenn/check_smart_attributes/master/check_smartdb.json in the readme no longer works. The last working smartdb is located at https://raw.githubusercontent.com/thomas-krenn/check_smart_attributes/c83683e1b82f7e173049d2b9a1727432c39e8f86/check_smartdb.json

The readme should be updated for now, with plans to support this new format moving forward.

@tabnul
Copy link

tabnul commented Apr 1, 2020

Encountered the same problem indeed.
Error below if you use the old devices db:

Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:     sys.exit(main())
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:   File "/usr/local/lib/python3.7/dist-packages/prometheus_smart_exporter/__init__.py", line 355, in main
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:     device_db.load(f)
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:   File "/usr/local/lib/python3.7/dist-packages/prometheus_smart_exporter/devicedb.py", line 43, in load
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:     for id_, type_ in device_info["ID#"].items()
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:   File "/usr/local/lib/python3.7/dist-packages/prometheus_smart_exporter/devicedb.py", line 43, in <dictcomp>
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]:     for id_, type_ in device_info["ID#"].items()
Apr 01 21:51:37 homeserver1 prometheus_smart_exporter[23208]: TypeError: unhashable type: 'dict'
Apr 01 21:51:37 homeserver1 systemd[1]: prometheus_smart_exporter.service: Main process exited, code=exited, status=1/FAILURE
Apr 01 21:51:37 homeserver1 systemd[1]: prometheus_smart_exporter.service: Failed with result 'exit-code'.

@horazont
Copy link
Collaborator

horazont commented Apr 2, 2020

Hi!

Thanks for the report. We can’t look into this with high priority at the moment, since these are Interesting Times.

We’d be happy to review and approve a PR fixing this though.

@tabnul
Copy link

tabnul commented Apr 2, 2020

No worries, the workaround posted by @RaptahJezus works. I am just posting the logs here as a reference for people who google the errors , like i did.

amiloradovsky pushed a commit to amiloradovsky/prometheus_smart_exporter that referenced this issue Apr 27, 2020
@amiloradovsky amiloradovsky linked a pull request Apr 27, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants