Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Commit

Permalink
The IRC message class isn't fully implemented; make this clear
Browse files Browse the repository at this point in the history
Also fixes the command definition for notify-host-by-irc
  • Loading branch information
aemcknig committed Aug 14, 2015
1 parent 5717d7d commit e92b1ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/nagios-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions lib/nagios-herald/messages/irc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e92b1ca

Please sign in to comment.