diff --git a/docs/messages.md b/docs/messages.md index 1c9c603..bb25357 100644 --- a/docs/messages.md +++ b/docs/messages.md @@ -4,7 +4,7 @@ While [formatters](/docs/formatters.md) are crucial to contextualizing alerts, i ``nagios-herald`` provides a base Message class (``Message::Base``) from which all Message subclasses inherit. ``Message::Base`` knows that all messages have content and recipients; it's the job of the Message subclasses to define additional behavior (such as how to send a message). -Three message types are defined in ``nagios-herald``: Email, Pager, and IRC. Feel free to cook up any new message types (i.e. CarrierPigeon, SmokeSignal) as you see fit. +Three message types are defined in ``nagios-herald``: Email, Pager, and IRC. The IRC class must be subclassed by a custom message class so that the ``send`` function can be implemented. Feel free to cook up any new message types (i.e. CarrierPigeon, SmokeSignal) as you see fit. ## Getting Content into Messages diff --git a/docs/nagios-config.md b/docs/nagios-config.md index ac331e4..75509fa 100644 --- a/docs/nagios-config.md +++ b/docs/nagios-config.md @@ -34,8 +34,8 @@ define command { # IRC (optional) define command { - command_name notify-service-by-irc - command_line /usr/local/nagios-herald/bin/nagios-herald --message-type irc --formatter=$_SERVICEMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://nagios.example.com/nagios/cgi-bin/cmd.cgi --reply-to=nagios@example.com + command_name notify-host-by-irc + command_line /usr/local/nagios-herald/bin/nagios-herald --message-type irc --formatter=$_HOSTMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://nagios.example.com/nagios/cgi-bin/cmd.cgi --reply-to=nagios@example.com } define command { diff --git a/lib/nagios-herald/messages/irc.rb b/lib/nagios-herald/messages/irc.rb index 58b36f0..34f27e5 100644 --- a/lib/nagios-herald/messages/irc.rb +++ b/lib/nagios-herald/messages/irc.rb @@ -47,9 +47,7 @@ def send return end - # TODO: Actually make this send to an IRC server - # I expect the IRC server will be a value in the config - self.print + raise NotImplementedError.new("#{self.class.name}#send is an abstract method and must be implemented by a subclass.") end end