bin/metrics-ceph-osd.rb in sensu-plugins-ceph-0.0.5 vs bin/metrics-ceph-osd.rb in sensu-plugins-ceph-1.0.0
- old
+ new
@@ -72,12 +72,12 @@
# #YELLOW
Dir.glob(config[:pattern]).each do |socket|
data = `ceph --admin-daemon #{socket} perf dump`
if $CHILD_STATUS.exitstatus == 0
# Left side of wildcard
- strip1 = config[:pattern].match(/^.*\*/).to_s.gsub(/\*/, '')
+ strip1 = config[:pattern].match(/^.*\*/).to_s.delete('*')
# Right side of wildcard
- strip2 = config[:pattern].match(/\*.*$/).to_s.gsub(/\*/, '')
+ strip2 = config[:pattern].match(/\*.*$/).to_s.delete('*')
osd_num = socket.gsub(strip1, '').gsub(strip2, '')
JSON.parse(data).each do |k, v|
k = k.gsub(/\/$/, '').gsub(/\//, '_')
output_data(v, "#{osd_num}.#{k}")
end