Skip to content

Commit

Permalink
Merge pull request #49 from xorpaul/allow_non_200_http_code
Browse files Browse the repository at this point in the history
allow non 200 HTTP return code to be OK, fixes #48
  • Loading branch information
phrawzty authored Aug 17, 2021
2 parents 58a2f0e + a5973eb commit d98a0bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions check_http_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ def uri_target(options)
end
end
end
msg = 'Received HTTP code %s instead of 200.' % [response.code]
Nagios.do_exit(level.to_i, msg)
if not level == 0 then
msg = 'Received HTTP code %s instead of 200.' % [response.code]
Nagios.do_exit(level.to_i, msg)
end
end

say(options[:v], "RESPONSE:\n---\n%s\n---" % [response.body])
Expand Down

0 comments on commit d98a0bf

Please sign in to comment.