-
Notifications
You must be signed in to change notification settings - Fork 21
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
struct.error: unpack requires a buffer of 9 bytes #11
Comments
I can confirm identical behavior on Python 3.6.9. Smartmontools v7.0. prometheus_node_exporter installed via pip3. I attempted to chop the device.json down in case that was causing it.
I ran the helper in another console with -vvv, and this is what I got:
That error message pops up right as I attempt to launch the exporter. I notice that the drive in question that's crashing this is a Seagate ST3000DM001. For some unknown reason it returns the following when running
None of my other drives return a value for attribute 240. Looking through the git repo, I see there was a sanity check added on fix #3 that verifies whether the raw values are actual integers or not. I updated
These checks were not present on the file I installed via pip3. |
try to run: # /usr/local/bin/prometheus_smart_exporter --device-db /etc/prometheus/exporters/smart/devices.json -a 0.0.0.0 -p 9257 -vv /var/run/prometheus_smart_helper/ipc
INFO:prometheus_smart_exporter:device db loaded with 4 devices
INFO:prometheus_smart_exporter:attribute_mapping loaded with 16 generic rules, 0 per device rules for 0 devices
Traceback (most recent call last):
File "/usr/local/bin/prometheus_smart_exporter", line 10, in
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/prometheus_smart_exporter/init.py", line 402, in main
logger.getChild("collector")
File "/usr/local/lib/python3.6/dist-packages/prometheus_client/registry.py", line 24, in register
names = self._get_names(collector)
File "/usr/local/lib/python3.6/dist-packages/prometheus_client/registry.py", line 64, in _get_names
for metric in desc_func():
File "/usr/local/lib/python3.6/dist-packages/prometheus_smart_exporter/init.py", line 105, in collect
data = self._recv_smart_info(sock)
File "/usr/local/lib/python3.6/dist-packages/prometheus_smart_exporter/init.py", line 82, in _recv_smart_info
ver, length = Header.unpack(hdr)
struct.error: unpack requires a buffer of 9 bytes
/usr/bin/python3 -V
Python 3.6.8
uname -a
Linux backup 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
ls -la /var/run/prometheus_smart_helper/ipc
srw------- 1 prometheus prometheus 0 Sep 24 11:01 /var/run/prometheus_smart_helper/ipc
The text was updated successfully, but these errors were encountered: