class Malsh::Notification::Base

Public Class Methods

doit?() click to toggle source
# File lib/malsh/notification/base.rb, line 22
def self.doit?
  true
end
notify_alert(subject, alerts) click to toggle source
# File lib/malsh/notification/base.rb, line 10
def self.notify_alert(subject, alerts)
  puts "#{subject}: "
  alerts.each do |alert|
    title = if Malsh.alert_has_host?(alert)
              alert.host.name
            else
              alert.monitor.name
            end
    puts "#{title}: #{alert.message}"
  end
end
notify_host(subject, hosts) click to toggle source
# File lib/malsh/notification/base.rb, line 3
def self.notify_host(subject, hosts)
  puts "#{subject}:"
  hosts.map do |h|
    puts "#{h.name}(#{h.roles.keys.join(",")})"
  end if doit?
end