Skip to content

Commit

Permalink
Merge pull request #2 from lausser/master
Browse files Browse the repository at this point in the history
expected response code can be a comma-separated list of codes
  • Loading branch information
m-kraus authored Oct 8, 2020
2 parents e7a0ba8 + c69ad4b commit b9021a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ On Debian or Ubuntu install those packages:
-f Follow redirects
-k Ignore SSL certificate errors

-e Expected HTTP response code [HTTP_RESPONSE_CODE]
-e Expected HTTP response code [HTTP_RESPONSE_CODE[,HTTP_RESPONSE_CODE,...]]

--proxy Proxy [http://PROXY:PORT]
--agent Agent [USER_AGENT]
Expand Down
4 changes: 2 additions & 2 deletions check_curly
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Originally written by Vit Safar, extended by Michael Kraus
-f Follow redirects
-k Ignore SSL certificate errors
-e Expected HTTP response code [HTTP_RESPONSE_CODE]
-e Expected HTTP response code [HTTP_RESPONSE_CODE[,HTTP_RESPONSE_CODE,...]]
--proxy Proxy [http://PROXY:PORT]
--agent Agent [USER_AGENT]
Expand Down Expand Up @@ -363,7 +363,7 @@ $body


if (isset($Expected)) {
if ($http_code != $Expected) {
if (! in_array($http_code, explode(",", $Expected))) {
$Msg.='CRITICAL http_response code '.$http_code.' does not match expected '.$Expected;
nagios_exit(2);
}
Expand Down

0 comments on commit b9021a8

Please sign in to comment.