Skip to content

fix: allow configuring powermode check to work better with SSDs #242

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

Conversation

rbjorklin
Copy link
Contributor

By setting --nocheck=never I can correctly scrape SMART metrics from SSDs that report a standby power state:

# hdparm -C /dev/sda

/dev/sda:
 drive state is:  standby

fixes #91

@rbjorklin rbjorklin force-pushed the introduce-powermode-check-override branch from e80b26f to b442301 Compare September 9, 2024 22:32
rbjorklin added a commit to rbjorklin/helm-charts that referenced this pull request Sep 9, 2024
Requires: prometheus-community/smartctl_exporter/pull/242

Signed-off-by: Robin Björklin <robin.bjorklin@gmail.com>
rbjorklin added a commit to rbjorklin/helm-charts that referenced this pull request Sep 9, 2024
Requires: prometheus-community/smartctl_exporter/pull/242

Signed-off-by: Robin Björklin <robin.bjorklin@gmail.com>
rbjorklin added a commit to rbjorklin/helm-charts that referenced this pull request Sep 9, 2024
Requires: prometheus-community/smartctl_exporter#242

Signed-off-by: Robin Björklin <robin.bjorklin@gmail.com>
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to avoid invalid string injection, would you please add a switch statement in main.go to validate input of the flag?

@denyago
Copy link

denyago commented Jan 14, 2025

I hope one would fix & merge this pr. 🙏

I've got the same issue with a USB drive.

Fixed it by adding a UDEV rule:

ACTION=="add", SUBSYSTEM=="usb", ATTR{power/autosuspend}="0"

@rbjorklin rbjorklin force-pushed the introduce-powermode-check-override branch from 7abdde5 to 34b085a Compare February 12, 2025 23:28
fixes prometheus-community#91

Signed-off-by: Robin Björklin <robin.bjorklin@gmail.com>
@rbjorklin rbjorklin force-pushed the introduce-powermode-check-override branch from 34b085a to 9bf4ec8 Compare February 13, 2025 00:54
@rbjorklin
Copy link
Contributor Author

In order to avoid invalid string injection, would you please add a switch statement in main.go to validate input of the flag?

@SuperQ I'm not sure what you had in mind but does this work for you?

@k0ste
Copy link
Contributor

k0ste commented Apr 3, 2025

Fixes #287

@rbjorklin
Copy link
Contributor Author

@NiceGuyIT could I bother you to review and merge this?

@NiceGuyIT NiceGuyIT merged commit 64b24c3 into prometheus-community:master Apr 22, 2025
4 checks passed
@NiceGuyIT
Copy link
Member

@rbjorklin Done!

Thanks for the nudge. :)

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 this pull request may close these issues.

Device open failed, device did not return an IDENTIFY DEVICE structure,
5 participants