bin/metrics-disk-capacity.rb in sensu-plugins-disk-checks-1.0.1 vs bin/metrics-disk-capacity.rb in sensu-plugins-disk-checks-1.0.2
- old
+ new
@@ -37,28 +37,27 @@
#
class DiskCapacity < Sensu::Plugin::Metric::CLI::Graphite
option :scheme,
description: 'Metric naming scheme, text to prepend to .$parent.$child',
long: '--scheme SCHEME',
- default: "#{Socket.gethostname}.disk"
+ default: "#{Socket.gethostname}"
# Unused ?
#
def convert_integers(values)
values.each_with_index do |value, index|
begin
converted = Integer(value)
values[index] = converted
- # #YELLOW
rescue ArgumentError # rubocop:disable HandleExceptions
end
end
values
end
# Main function
#
- def run # rubocop:disable all
+ def run
# Get capacity metrics from DF as they don't appear in /proc
`df -PT`.split("\n").drop(1).each do |line|
begin
fs, _type, _blocks, used, avail, capacity, _mnt = line.split