bin/metrics-disk-capacity.rb in sensu-plugins-disk-checks-3.1.0 vs bin/metrics-disk-capacity.rb in sensu-plugins-disk-checks-3.1.1
- old
+ new
@@ -66,11 +66,11 @@
begin
fs, _type, _blocks, used, avail, capacity, _mnt = line.split
timestamp = Time.now.to_i
if fs =~ /\/dev/
- fs = fs.tr('/dev/', '')
+ fs = fs.sub('/dev/', '')
metrics = {
disk: {
"#{fs}.used" => used,
"#{fs}.avail" => avail,
"#{fs}.capacity" => capacity.delete('%')
@@ -93,10 +93,10 @@
begin
fs, _inodes, used, avail, capacity, _mnt = line.split
timestamp = Time.now.to_i
if fs =~ /\/dev/
- fs = fs.tr('/dev/', '')
+ fs = fs.sub('/dev/', '')
metrics = {
disk: {
"#{fs}.iused" => used,
"#{fs}.iavail" => avail,
"#{fs}.icapacity" => capacity.delete('%')