From 7ee5acc25e47a0d1c8d27acb8ce4e80ad48087b6 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Fri, 23 Nov 2012 10:23:51 +0000 Subject: Added minimal_dns_lookups configuration directive to allow alert-group DNS lookups to occur when needed. --- lib/mauve/configuration.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/mauve/configuration.rb') diff --git a/lib/mauve/configuration.rb b/lib/mauve/configuration.rb index 457fb4d..8a2ed74 100644 --- a/lib/mauve/configuration.rb +++ b/lib/mauve/configuration.rb @@ -40,6 +40,7 @@ module Mauve # attr_reader :bytemark_auth_url, :bytemark_calendar_url, :remote_http_timeout, :remote_https_verify_mode, :failed_login_delay attr_reader :max_acknowledgement_time, :working_hours, :dead_zone, :daytime_hours + attr_reader :minimal_dns_lookups # @@ -69,6 +70,11 @@ module Mauve # self.failed_login_delay = 1 + # + # Reduce the amount of DNS lookups when matching alerts to groups. + # + self.minimal_dns_lookups = false + # # Maximum amount of time to acknowledge for # @@ -247,6 +253,14 @@ module Mauve end + def minimal_dns_lookups=(bool) + if bool.is_a?(TrueClass) or bool.to_s.strip =~ /^(1|y(es)?|t(rue))/ + @minimal_dns_lookups = true + else + @minimal_dns_lookups = false + end + end + end -- cgit v1.2.1