Skip to content

Add --compat-disk-labels option #247

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deajan
Copy link
Contributor

@deajan deajan commented Jul 18, 2025

So I use smartmon.sh for years now.
Migrating to smartmon.py, I really got frustrated because metrics like:

smartmon_device_info{disk="/dev/sda" [...]}

became

smartmon_device_info{device="/dev/sda", disk="0" [...]}

So basically I have to batch update all my instances, or develop new dashboards (I can't get disk or device variable in grafana, one has to choose).

So my proposition is to add --compat-disk-labels to smartmon.py in order for the latter to generate metrics with the same disk name as previously found in smarmon.sh.

Modification is applied explicitly, so no behavior changes for existing setups.

Signed-off-by: Orsiris de Jong <[email protected]>
@dswarbrick
Copy link
Member

If you really need this backwards compatible label, you can achieve it with a Prometheus relabel rule.

@deajan
Copy link
Contributor Author

deajan commented Jul 18, 2025

The problem being that both metrics have a disk entry, and only the ones from smartmon.py would need relabeling.
I honestly think it's easier to install new setups so they can be compatible with existing ones (the less work).

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.

2 participants