Skip to content

Commit

Permalink
check_http reports warning where it should report ok with -e
Browse files Browse the repository at this point in the history
Fix for issue #236
  • Loading branch information
John C. Frickson committed Feb 27, 2017
1 parent 9e616bc commit 7300528
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ This file documents the major additions and syntax changes between releases.
x.x.x xxxx-xx-xx
FIXES
check_users: not accepting zero as the threshold
check_http: reports warning where it should report ok with -e


2.2.0 2017-01-19
Expand Down
6 changes: 4 additions & 2 deletions plugins/check_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,14 @@ check_http (void)
/* server errors result in a critical state */
else if (http_status >= 500) {
xasprintf (&msg, _("%s%s - "), msg, status_line);
result = STATE_CRITICAL;
if (bad_response || !server_expect_yn)
result = STATE_CRITICAL;
}
/* client errors result in a warning state */
else if (http_status >= 400) {
xasprintf (&msg, _("%s%s - "), msg, status_line);
result = max_state_alt(STATE_WARNING, result);
if (bad_response || !server_expect_yn)
result = max_state_alt(STATE_WARNING, result);
}
/* check redirected page if specified */
else if (http_status >= 300) {
Expand Down

6 comments on commit 7300528

@smooge
Copy link

@smooge smooge commented on 7300528 Feb 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I fixed it with this patch but it may not have actually 'fixed' it.

@smooge
Copy link

@smooge smooge commented on 7300528 Feb 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfrickson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't seem to get at your patch. Email it to me - jfrickson@nagios.com - Thanks.

@waja
Copy link
Contributor

@waja waja commented on 7300528 Feb 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waja
Copy link
Contributor

@waja waja commented on 7300528 Feb 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfrickson there are troubles at github: https://twitter.com/githubstatus/status/836637202683678720 ... just try it again a bit later. :)

@jfrickson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@waja ok, thanks

Please sign in to comment.