sensu-plugins-disk-checks
sensu-plugins-disk-checks copied to clipboard
check-disk-usage always shows the non-magic usage under ‘OK’
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%.
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.
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%