summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-12-12 14:36:37 +0000
committerSteve Kemp <steve@steve.org.uk>2012-12-12 14:36:37 +0000
commit802edec157b204e68851142df94296ec013e2847 (patch)
tree91295bc5dfff1a06d60b1a7d024b38e06ced440f
parent132609667e4dff0b0eda98dce85a75ca12b59c7c (diff)
The suppression periods are now configurable toorelease-0.8-6
-rw-r--r--etc/custodian/custodian.cfg5
-rw-r--r--lib/custodian/alerts/mauve.rb10
2 files changed, 13 insertions, 2 deletions
diff --git a/etc/custodian/custodian.cfg b/etc/custodian/custodian.cfg
index 8d33796..1a03613 100644
--- a/etc/custodian/custodian.cfg
+++ b/etc/custodian/custodian.cfg
@@ -72,4 +72,9 @@
# day_start = 10
# day_end = 18
#
+#
+# The periods involved, in minutes:
+#
+# working_suppress = 4
+# oncall_suppress = 10
## \ No newline at end of file
diff --git a/lib/custodian/alerts/mauve.rb b/lib/custodian/alerts/mauve.rb
index a467215..7f06dfd 100644
--- a/lib/custodian/alerts/mauve.rb
+++ b/lib/custodian/alerts/mauve.rb
@@ -100,18 +100,24 @@ module Custodian
day_end = @settings.key( "day_end" ) || 18
#
+ # In hour suppress
+ #
+ working_suppress = @settings.key( "working_suppress" ) || 4
+ oncall_suppress = @settings.key( "oncall_suppress" ) || 10
+
+ #
# If we're Monday-Friday, between the start & end time, then
# we're in the working day.
#
if ( ( ( wday != 0 ) && ( wday != 6 ) ) &&
- ( hour >= day_start && < day_end ) )
+ ( hour >= day_start && hour < day_end ) )
working = true
end
#
# The suppression period can now be determined.
#
- period = working ? 4 : 10
+ period = working ? working_suppress : oncall_suppress
#
# And logged.