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

Adaptive thresholds? #14

Closed
joshbeard opened this issue Aug 21, 2015 · 2 comments
Closed

Adaptive thresholds? #14

joshbeard opened this issue Aug 21, 2015 · 2 comments

Comments

@joshbeard
Copy link
Contributor

I'm curious what the thoughts are on providing "adaptive thresholds" for the percentages. For instance, 10% free of a 100GB volume is arguably more severe than 10% free of a 10TB volume. Adapting the thresholds based on volume size would allow for a single check to be more fitting of different volumes without triggering undesirable alerts.

This features is available in check_mk's disk check. I've forked the Sensu plugin here and added this functionality in if anyone would like to take a look and consider it:
https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/master...joshbeard:adaptive?expand=1

The idea is that you provide base percentages for warning and critical thresholds. These percentages are slightly adjusted for larger filesystems based on a "magic factor" the user can provide. A magic factor of 0 (the default) does no adjustment at all (current behavior). There's also an option to modify the normalized factor, where volumes of exactly that size will not be adjusted. Finally, there's an option to specify a minimum size to adjust, so volumes smaller than this will not be adapted.

This can be visualized with WolframAlpha with something like the following:

y = 100 - (100-P)*(N^(1-m))/(x^(1-m)), y = P for x in 0 to 1024

Where P = base percentage, N = normalize factor, and m = magic factor

@mattyjones
Copy link
Member

@joshbeard I am more than happy to think about it. Off-hand I see no problem with it as long as you can use the check without the thresholds, which it looks like you can.

@joshbeard
Copy link
Contributor Author

Correct. These additions don't change the default behavior at all.

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

No branches or pull requests

2 participants