From 57833ffddeb495b53c0cac168df6dd03cde4ddb1 Mon Sep 17 00:00:00 2001 From: Akira Maeda Date: Fri, 25 Oct 2013 16:21:59 +0900 Subject: [PATCH] colorize irc notification. --- handlers/notification/irc.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handlers/notification/irc.rb b/handlers/notification/irc.rb index 1f5283b3d..d6db8e3a4 100755 --- a/handlers/notification/irc.rb +++ b/handlers/notification/irc.rb @@ -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, }