sensu-plugins-disk-checks icon indicating copy to clipboard operation
sensu-plugins-disk-checks copied to clipboard

check-disk-usage always shows the non-magic usage under ‘OK’

Open Debilski opened this issue 9 years ago • 2 comments

When ok is returned, the return text does not take the magic number into account and uses config[:bwarn]. This is especially confusing, when only one mount is being checked:

$ /opt/sensu/embedded/bin/check-disk-usage.rb -I /extra -m 1
CheckDisk CRITICAL: /extra 96.07% bytes usage (386 GiB/402 GiB)
$ /opt/sensu/embedded/bin/check-disk-usage.rb -I /extra -m 0.6
CheckDisk OK: All disk usage under 85% and inode usage under 85%

Obviously, the disk usage is over 85%.

Debilski avatar Mar 08 '16 10:03 Debilski

I'll add that we are running into this issue as well. This is very confusing, especially when debugging. [EDIT] - This is also confusing to the oncall engineers who get the OK alert.

bgupta avatar Sep 27 '16 14:09 bgupta

adding this piece of code puts "Magic threshold for #{line.mount_point} - warn:#{bwarn}%, crit: #{bcrit}%" into the check_mount() function gives you the info. but this is quite a hack and probably not the expected output of a check. I wonder what's the best way to include all the usefull information in one line.

Magic threshold for / - warn:80%, crit: 90% Magic threshold for /boot - warn:80%, crit: 90% Magic threshold for /var - warn:92.14777308396799%, crit: 96.073886541984% CheckDisk OK: All disk usage under 80% and inode usage under 85%

exeral avatar Mar 21 '18 16:03 exeral