summaryrefslogtreecommitdiff
path: root/lib/custodian
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-20 15:52:23 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-20 15:52:23 +0000
commit23b836399f07f8d731d6b6c073c7f9606b5bf634 (patch)
treef2212c1fe57d0937c1926aea33dd1de428310293 /lib/custodian
parent1f6d8ce6e46678e7e9873b2c9846eab9bb8fe596 (diff)
Default to a 200-status code check.
Diffstat (limited to 'lib/custodian')
-rw-r--r--lib/custodian/parser.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index ce6ad1e..b7b4279 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -428,20 +428,23 @@ class MonitorConfig
#
#
if ( test[:test_type] =~ /^https?/ )
- found = 0
+ #
+ # If a status code is specified use it; otherwise default
+ # to 200.
if ( line =~ /\s+with\s+status\s+([0-9]+)\s+/ )
- test[:http_status]=$1.dup
- found += 1
+ test[:http_status] = $1.dup
+ else
+ test[:http_status] = 200
end
+
+ #
+ # If a content-check is in place then use it.
+ #
if ( line =~ /\s+with\s+content\s+'([^']+)'/ )
test[:http_text]=$1.dup
- found += 1
end
- if ( found == 0 )
- puts "WARNING: Neither an expected text, or a status code, were specified in the line: #{line}"
- end
end