notify (God::Task)

    # File lib/god/task.rb, line 456
        def notify(condition, message)
          spec = Contact.normalize(condition.notify)
          unmatched = []

          # resolve contacts
          resolved_contacts =
          spec[:contacts].inject([]) do |acc, contact_name_or_group|
            cons = Array(God.contacts[contact_name_or_group] || God.contact_groups[contact_name_or_group])
            unmatched << contact_name_or_group if cons.empty?
            acc += cons
            acc
          end

          # warn about unmatched contacts
          unless unmatched.empty?
            msg = "#{condition.watch.name} no matching contacts for '#{unmatched.join(", ")}'"
            applog(condition.watch, :warn, msg)
          end

          # notify each contact
          resolved_contacts.each do |c|
            host = `hostname`.chomp rescue 'none'
            c.notify(message, Time.now, spec[:priority], spec[:category], host)

            msg = "#{condition.watch.name} #{c.info ? c.info : "notification sent for contact: #{c.name}"} (#{c.base_name})"

            applog(condition.watch, :info, msg % [])
          end
        end