diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-20 15:52:23 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-20 15:52:23 +0000 |
commit | 23b836399f07f8d731d6b6c073c7f9606b5bf634 (patch) | |
tree | f2212c1fe57d0937c1926aea33dd1de428310293 /lib | |
parent | 1f6d8ce6e46678e7e9873b2c9846eab9bb8fe596 (diff) |
Default to a 200-status code check.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/custodian/parser.rb | 17 |
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 |