14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/kennel/unmuted_alerts.rb', line 14
def print(api, tag)
monitors = filtered_monitors(api, tag)
if monitors.empty?
puts "No unmuted alerts found"
else
monitors.each do |m|
puts m[:name]
puts Utils.path_to_url("/monitors/#{m[:id]}")
m[:state][:groups].each do |g|
color = COLORS[g[:status]] || :default
since = "\t#{time_since(g[:last_triggered_ts])}"
puts "#{Kennel::Utils.color(color, g[:status])}\t#{g[:name]}#{since}"
end
puts
end
end
end
|