Skip to content

Commit

Permalink
colorize irc notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
glidenote committed Oct 25, 2013
1 parent 31fe96f commit 57833ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion handlers/notification/irc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ def event_name
@event['client']['name'] + '/' + @event['check']['name']
end

def action_to_string
@event['action'].eql?('resolve') ? "\x0300,03RESOLVED\x03" : "\x0301,04ALERT\x03"
end

def handle
params = {
:uri => settings["irc"]["irc_server"],
:message => "#{event_name}: #{@event['check']['output']}",
:message => "#{action_to_string} #{event_name}: #{@event['check']['output']}",
:ssl => settings["irc"]["irc_ssl"],
:join => true,
}
Expand Down

0 comments on commit 57833ff

Please sign in to comment.