bin/metrics-disk-usage.rb in sensu-plugins-disk-checks-1.1.2 vs bin/metrics-disk-usage.rb in sensu-plugins-disk-checks-1.1.3
- old
+ new
@@ -97,10 +97,10 @@
# Get disk usage from df with used and avail in megabytes
# #YELLOW
`df -PB#{config[:block_size]} #{config[:local] ? '-l' : ''}`.split("\n").drop(1).each do |line|
_, _, used, avail, used_p, mnt = line.split
- unless %r{/sys|/dev|/run}.match(mnt)
+ unless %r{/sys[/|$]|/dev[/|$]|/run[/|$]}.match(mnt)
next if config[:ignore_mnt] && config[:ignore_mnt].find { |x| mnt.match(x) }
next if config[:include_mnt] && !config[:include_mnt].find { |x| mnt.match(x) }
if config[:flatten]
mnt = mnt.eql?('/') ? 'root' : mnt.gsub(/^\//, '')
else