Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow non 200 HTTP return code to be OK, fixes #48 #49

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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