Skip to content

Commit

Permalink
allow non 200 HTTP return code to be OK, fixes #48
Browse files Browse the repository at this point in the history
  • Loading branch information
xorpaul committed Aug 17, 2021
1 parent 58a2f0e commit a5973eb
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 a5973eb

Please sign in to comment.