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

Fix default Percent_Lifetime_Remain threshold handling when -w is giv… #93

Merged
merged 1 commit into from Sep 20, 2023

Conversation

ymartin-ovh
Copy link
Contributor

…en (issue #92)

Address issue when threshold is not set in the following case:
check_smart -i auto -g '/dev/sda' -w Reallocated_Sector_Ct=250 -l

Instead of 90, the threshold is 0 when -w is given without
Percent_Lifetime_Remain threshold.

…en (issue Napsty#92)

  Address issue when threshold is not set in the following case:
  check_smart -i auto -g '/dev/sda' -w Reallocated_Sector_Ct=250 -l

  Instead of 90, the threshold is 0 when -w is given without
  Percent_Lifetime_Remain threshold.
@ymartin-ovh
Copy link
Contributor Author

User given value ovetake 90% default value:

./check_smart.pl --skip-load-cycles -l -i auto -g '/dev/{sdb,sda}' -w Percent_Lifetime_Remain=85
OK: [/dev/sdb] - Device is clean [/dev/sdb] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 85) --- [/dev/sda] - Device is clean [/dev/sda] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 85)|

./check_smart.pl --skip-load-cycles -l -i auto -g '/dev/{sdb,sda}' -w Percent_Lifetime_Remain=95
OK: [/dev/sdb] - Device is clean [/dev/sdb] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 95) --- [/dev/sda] - Device is clean [/dev/sda] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 95)|

Default threshold is set to 90:

./check_smart.pl --skip-load-cycles -l -i auto -g '/dev/{sdb,sda}'
OK: [/dev/sdb] - Device is clean [/dev/sdb] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 90) --- [/dev/sda] - Device is clean [/dev/sda] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 90)|

If -w is given with an another threshold, default value is still set to 90:

./check_smart.pl --skip-load-cycles -l -i auto -g '/dev/{sdb,sda}' -w toto=2
OK: [/dev/sdb] - Device is clean [/dev/sdb] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 90) --- [/dev/sda] - Device is clean [/dev/sda] - Percent_Lifetime_Remain is non-zero (2) (but less than threshold 90)|

@Napsty Napsty merged commit 394f96e into Napsty:master Sep 20, 2023
1 check passed
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.

None yet

2 participants