summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_http.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 27127d6a..2c13dcdb 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -643,28 +643,30 @@ check_http (void)
643 643
644 /* check the return code */ 644 /* check the return code */
645 /* server errors result in a critical state */ 645 /* server errors result in a critical state */
646 if (strstr (status_line, "500") || 646 if (strstr (status_line, "500") || strstr (status_line, "501") ||
647 strstr (status_line, "501") || 647 strstr (status_line, "502") || strstr (status_line, "503") ||
648 strstr (status_line, "502") || 648 strstr (status_line, "504") || strstr (status_line, "505")) {
649 strstr (status_line, "503")) { 649 die (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line);
650 die (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line);
651 } 650 }
652 651
653 /* client errors result in a warning state */ 652 /* client errors result in a warning state */
654 if (strstr (status_line, "400") || 653 if (strstr (status_line, "400") || strstr (status_line, "401") ||
655 strstr (status_line, "401") || 654 strstr (status_line, "402") || strstr (status_line, "403") ||
656 strstr (status_line, "402") || 655 strstr (status_line, "404") || strstr (status_line, "405") ||
657 strstr (status_line, "403") || 656 strstr (status_line, "406") || strstr (status_line, "407") ||
658 strstr (status_line, "404")) { 657 strstr (status_line, "408") || strstr (status_line, "409") ||
658 strstr (status_line, "410") || strstr (status_line, "411") ||
659 strstr (status_line, "412") || strstr (status_line, "413") ||
660 strstr (status_line, "414") || strstr (status_line, "415") ||
661 strstr (status_line, "416") || strstr (status_line, "417")) {
659 die (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line); 662 die (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line);
660 } 663 }
661 664
662 /* check redirected page if specified */ 665 /* check redirected page if specified */
663 if (strstr (status_line, "300") || 666 if (strstr (status_line, "300") || strstr (status_line, "301") ||
664 strstr (status_line, "301") || 667 strstr (status_line, "302") || strstr (status_line, "303") ||
665 strstr (status_line, "302") || 668 strstr (status_line, "304") || strstr (status_line, "305") ||
666 strstr (status_line, "303") || 669 strstr (status_line, "306")) {
667 strstr (status_line, "304")) {
668 if (onredirect == STATE_DEPENDENT) { 670 if (onredirect == STATE_DEPENDENT) {
669 671
670 asprintf (&orig_url, "%s", server_url); 672 asprintf (&orig_url, "%s", server_url);