Class: Kennel::UnmutedAlerts
- Inherits:
-
Object
- Object
- Kennel::UnmutedAlerts
- Defined in:
- lib/kennel/unmuted_alerts.rb
Constant Summary collapse
- COLORS =
{ "Alert" => :red, "Warn" => :yellow, "No Data" => :cyan }.freeze
Class Method Summary collapse
Class Method Details
.print(api, tag) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# 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 puts "#{Kennel::Utils.color(color, g[:status])}\t#{g[:name]}" end puts end end end |