summaryrefslogtreecommitdiff
path: root/lib/custodian/alerter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian/alerter.rb')
-rw-r--r--lib/custodian/alerter.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/custodian/alerter.rb b/lib/custodian/alerter.rb
index da3571e..f78d299 100644
--- a/lib/custodian/alerter.rb
+++ b/lib/custodian/alerter.rb
@@ -83,10 +83,24 @@ class Alerter
#
# Test trange, and format the appropriate message.
#
+ inside = false;
if ( BYTEMARK_RANGES.any?{|range| range.include?(IPAddr.new(resolved.to_s))} )
- return "<p>#{host} resolves to #{resolved} which is inside the Bytemark network.</p>"
+ inside = true
+ end
+
+
+ if ( inside )
+ if ( resolved == target )
+ return "<p>#{host} is inside the Bytemark network.</p>"
+ else
+ return "<p>#{host} resolves to #{resolved} which is inside the Bytemark network.</p>"
+ end
else
- return "<p>#{host} resolves to #{resolved} which is not inside the Bytemark network.</p>"
+ if ( resolved == target )
+ return "<p>#{host} is OUTSIDE the Bytemark network.</p>"
+ else
+ return "<p>#{host} resolves to #{resolved} which is OUTSIDE the Bytemark network.</p>"
+ end
end
end