lib/riemann/babbler/plugins/runit.rb in riemann-babbler-1.2.3 vs lib/riemann/babbler/plugins/runit.rb in riemann-babbler-1.2.4

- old
+ new

@@ -19,18 +19,18 @@ end def read_run_status status = Array.new Dir.glob('/etc/service/*').each do |srv| - human_srv = ' ' + srv.gsub(/\/etc\/service\//, '') + human_srv = srv.gsub(/\/etc\/service\//, '') next if plugin.not_monit.include? human_srv stat_file = File.join(srv, 'supervise', 'stat') next unless File.exists? stat_file srv_uptime = uptime(srv) if (File.read( stat_file ).strip == 'run') && (srv_uptime > plugin.uptime) - status << {:service => plugin.service + human_srv , :state => 'ok', :description => "runit service #{human_srv} running", :metric => srv_uptime} + status << {:service => plugin.service + ' ' + human_srv , :state => 'ok', :description => "runit service #{human_srv} running", :metric => srv_uptime} else - status << {:service => plugin.service + human_srv , :state => 'critical', :description => "runit service #{human_srv} not running", :metric => srv_uptime} + status << {:service => plugin.service + ' ' + human_srv , :state => 'critical', :description => "runit service #{human_srv} not running", :metric => srv_uptime} end end status end