riemann-babbler 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,15 +21,15 @@ class Riemann::Babbler::Runit < Riemann::Babbler
|
|
21
21
|
def read_run_status
|
22
22
|
status = Array.new
|
23
23
|
Dir.glob('/etc/service/*').each do |srv|
|
24
|
-
human_srv =
|
24
|
+
human_srv = srv.gsub(/\/etc\/service\//, '')
|
25
25
|
next if plugin.not_monit.include? human_srv
|
26
26
|
stat_file = File.join(srv, 'supervise', 'stat')
|
27
27
|
next unless File.exists? stat_file
|
28
28
|
srv_uptime = uptime(srv)
|
29
29
|
if (File.read( stat_file ).strip == 'run') && (srv_uptime > plugin.uptime)
|
30
|
-
status << {:service => plugin.service + human_srv , :state => 'ok', :description => "runit service #{human_srv} running", :metric => srv_uptime}
|
30
|
+
status << {:service => plugin.service + ' ' + human_srv , :state => 'ok', :description => "runit service #{human_srv} running", :metric => srv_uptime}
|
31
31
|
else
|
32
|
-
status << {:service => plugin.service + human_srv , :state => 'critical', :description => "runit service #{human_srv} not running", :metric => srv_uptime}
|
32
|
+
status << {:service => plugin.service + ' ' + human_srv , :state => 'critical', :description => "runit service #{human_srv} not running", :metric => srv_uptime}
|
33
33
|
end
|
34
34
|
end
|
35
35
|
status
|