From: Stephen L Johnson Date: Sun, 9 Jul 2000 06:52:30 +0000 (+0000) Subject: added message template configuration section %TEMPLATES X-Git-Tag: spong-2_7-alpha7~12 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=006a7e47a93847349b0ed4d9b1d3b758b980d19d;p=spong.git added message template configuration section %TEMPLATES --- diff --git a/config/spong.message b/config/spong.message index 74d2fce..ce7e111 100755 --- a/config/spong.message +++ b/config/spong.message @@ -112,5 +112,93 @@ $MESSAGING_RULES = [ ]; + +# These message templates determine how notifictions are formatted. It is +# a perl "hash" that define the information. If you don't know Perl , don't be +# scared, you just need to copy the templates for one of the rules. +# +# The following describes the %TEMPLATES hash. +# +# %TEMPLATES = ( [stanza], [stanza], [stanza] ); +# +# where [stanza] is a second hash, that looks like the following: +# +# 'templ-id' => { subject => 'spong - !!COLOR!! !!HOST!! !!SERVICE!!', +# body => '!!DATETIME!! +# !!COLOR!! !!HOST!! !!SERVICE!! +# !!SUMMARY!!' +# }, +# +# %TEMPLATES is a hash of hashes, that define the setup of variables for each +# message template. The 'templ-id' is the templates id key. It will consist +# of a %HUMAN entry key, a messaging module name, or a both combined with a +# semicolon (':'), the the 'DEFAULT' entry. A template will be searched for +# in the following order, 'contact:module', 'module', 'contact', 'DEFALT'. +# +# The variables of the hash are the notification message subject line +# and message body template strings. Any text in the template strings are +# printed verbatim. There are a number of substitution variables which +# represent various field of a status message na other misc. data. +# !!HOST!! - full domain name of host +# !!SHORTHOST!! - short host name of server +# !!COLOR!! - status color of event message +# !!STATUS!! - status color of event message +# !!WWWSPONG!! - the WWWSPONG URL variable from spong.conf +# !!SUMMARY!! - The summary message field from event message +# !!DETAILED!! - The detail message field from the event message +# !!CURTIME!! - The current system tme in formated by $DATETIMEFORMAT +# !!DATE!! - The date of the event message formatted by $DATEFORMAT +# !!TIME! - The time of the event message formatted by $TIMEFORMAT +# !!DATETIME!! - The date/time of the event message formateted by +# $DATETIMEFORMAT + +%TEMPLATES = ( + + 'DEFAULT' => { subject => 'spong - !!COLOR!! !!HOST!! !!SERVICE!!', + body => +'!!DATETIME!! +!!COLOR!! !!HOST!! !!SERVICE!! +!!SUMMARY!!', + }, + + ## Depending on how your $WWWSPONG variable in spong.conf is configured + ## Your will use this format + 'email' => { subject => 'spong - !!COLOR!! !!HOST!! !!SERVICE!!', + body => +'Host !!HOST!! service has been reported !!COLOR!!. +Summary: !!SUMMARY!! + +Spong Web Page: !!WWWSPONG!! +Service Detail Page: !!WWWSPONG!!/service/!!HOST!!/!!SERVICE!! + +Status event details: +!!DETAILED!! +', + }, + + ## Or this format + 'email2' => { subject => 'spong - !!COLOR!! !!HOST!! !!SERVICE!!', + body => +'Host !!HOST!! service has been reported !!COLOR!!. +Summary: !!SUMMARY!! + +Spong Web Page: http://spong-server.myinc.com/!!WWWSPONG!! +Service Detail Page: http://spong-server.myinc.com/!!WWWSPONG!!/service/!!HOST!!/!!SERVICE + +Status event details: +!!DETAILED!! +', + }, + + # Small message template for Bob's tiny pager + 'bob:skytel' => { # No subject line + body => '!!COLOR!! !!HOST!! !!SERVICE!!', + }, + +); + + + + # This is needed because this is included perl code. 1;