# This flag determines the how the overall rules are matched due a rules scan
# 'FIRST-MATCH' means that the first rule matches is used and the scanning stop
# 'ALL' mean that all matching rules are processed
$RULES_MATCH = 'FIRST-MATCH';
$MESSAGING_RULES = [
# Comprehensive rules example showing everything
# {
# hosts => ['perl-re','perl-re','perl-re'],
# host_groups => [ 'group1','group2','group3'],
# services => ['dns','cpu','local'],
# exclude_hosts => ['.*mktu','chr.*'],
# exclude_services => ['disk','dns','misc'],
# exlcude_host_groups => ['group1','group2','group3'],
# times => [
# { days => ['0','1-3','4-5'],
# times => ['06:30-18:30','21:00-22:00'] },
# { days => ['5','6','0-2'] },
# { times => ['13:00-15:23','00:00-23:39'] }
# ]
# contacts => [ stanza, stanza, ... stanza],
# },
#
# Where a contact stanza can be any of the following:
# 1) 'human' - a string which contains a key from the $HUMANS data
# in the spong.hosts file. Examples:
# 'unix-staff', 'lan-staff', ...
# 2) 'human:func' - a string which contains a key and a message type
# seperated from by a colon (':') Examples:
# 'unix-staff:email', 'edhill:skytel'
# 3) { rcpt=>'string', [delay=>nn], [repeat=>nn] },
# A hash as written above.
# A) The rcpt field is a string as defined in 1) or 2) above. (REQUIRED)
# B) The delay field is a number. The number of seconds a service has in
# duration before an initial message is sent. (OPTIONAL)
# C) The repeat field is a number. The number of seconds to wait after
# a previous message to send the next message. (OPTIONAL)
# Examples:
# { rcpt=>'unix-staff', delay=>900, repeat=>600 }
# Send notification to 'unix-staff' when something is down for 15
# minutes and repeat notification every 10 minutes.
# { rcpt=>'edhill:skytel', repeat=>900 }
# Send notification to Ed Hill Skytel pager immediately when
# something goes down, and send out repeat messages every 15
# minutes.
# { rcpt=>'theboss:pager', delay=7200, repeat=>3600 }
# Let The Boss know if something is down for more then 2 hours
# { rcpt=>'unix-staff:email' }
# This is the same as 2) above. Immediage notifications and no
# repeat messages.
#
# *** Don't forget the comma between each rule hash.
#
#
{ name => 'foo 1',
hosts => [ 'system.foo.com' ],
services => ['.*'],
contacts => [
{ rcpt => 'joe,joe-page', delay => 600, repeat => 3600 },
# { rcpt => 'joe-page', delay => 600, repeat => 1800 }
],
},
{ name => 'foo 2',
hosts => [ 'system1.foo.com' ],
services => ['.*'],
contacts => [
{ rcpt => 'joe', delay => 600, repeat => 3600 },
],
},
{ name => 'King of the monsters',
hosts => ['godzilla'],
# contacts => [ 'group-test' ],
},
{ name => 'aka King Ghidora',
hosts => ['zero'],
# contact => [ 'group-test' ],
},
];
# Message templates for formatting how messages are sent.
%TEMPLATES = (
'DEFAULT' => {
subject => 'spong - !!HOST!! !!SERVICE!! !!COLOR!!',
body => '!!HOST!! !!SERVICE!! !!COLOR!!\n!!SUMMARY',
},
'email' => {
subject => 'spong - !!HOST!! !!SERVICE!! !!COLOR!!',
body => '!!HOST!! !!SERVICE!! !!COLOR!!- !!SUMMARY!!
Host Display: !!HOST!!
Service Display: !!HOST!!/!!SERVICE!!
Detailed Information:
!!DETAILED!!'
},
'alltelsms' => {
subject => 'spong',
body => '!!SHORTHOST!! !!SERVICE!! !!COLOR!!',
},
);
# This is needed because this is included perl code.
1;