diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-07 11:51:12 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-07 11:51:12 +0000 |
commit | 9e17dab6c3e4b4e7142f3ea5b2a60fcd488dc709 (patch) | |
tree | cb5831f4c018edc441686b2fe7715eb91de4ffee /plugins/check_http.c | |
parent | 7f1bb2a782a008b55b0ef657ec01d7fbdb637fd4 (diff) | |
download | monitoring-plugins-9e17dab6c3e4b4e7142f3ea5b2a60fcd488dc709.tar.gz |
replace "terminate" with "die" for shorter name and better readability
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@656 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 951c7641..b5f2a562 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -285,7 +285,7 @@ main (int argc, char **argv) | |||
285 | #ifdef HAVE_SSL | 285 | #ifdef HAVE_SSL |
286 | if (use_ssl && check_cert == TRUE) { | 286 | if (use_ssl && check_cert == TRUE) { |
287 | if (connect_SSL () != OK) | 287 | if (connect_SSL () != OK) |
288 | terminate (STATE_CRITICAL, | 288 | die (STATE_CRITICAL, |
289 | _("HTTP CRITICAL - Could not make SSL connection\n")); | 289 | _("HTTP CRITICAL - Could not make SSL connection\n")); |
290 | if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) { | 290 | if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) { |
291 | result = check_certificate (&server_cert); | 291 | result = check_certificate (&server_cert); |
@@ -596,7 +596,7 @@ check_http (void) | |||
596 | if (use_ssl == TRUE) { | 596 | if (use_ssl == TRUE) { |
597 | 597 | ||
598 | if (connect_SSL () != OK) { | 598 | if (connect_SSL () != OK) { |
599 | terminate (STATE_CRITICAL, _("Unable to open TCP socket")); | 599 | die (STATE_CRITICAL, _("Unable to open TCP socket")); |
600 | } | 600 | } |
601 | 601 | ||
602 | if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) { | 602 | if ((server_cert = SSL_get_peer_certificate (ssl)) != NULL) { |
@@ -611,7 +611,7 @@ check_http (void) | |||
611 | else { | 611 | else { |
612 | #endif | 612 | #endif |
613 | if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK) | 613 | if (my_tcp_connect (server_address, server_port, &sd) != STATE_OK) |
614 | terminate (STATE_CRITICAL, _("Unable to open TCP socket")); | 614 | die (STATE_CRITICAL, _("Unable to open TCP socket")); |
615 | #ifdef HAVE_SSL | 615 | #ifdef HAVE_SSL |
616 | } | 616 | } |
617 | #endif | 617 | #endif |
@@ -669,14 +669,14 @@ check_http (void) | |||
669 | if (use_ssl) { | 669 | if (use_ssl) { |
670 | sslerr=SSL_get_error(ssl, i); | 670 | sslerr=SSL_get_error(ssl, i); |
671 | if ( sslerr == SSL_ERROR_SSL ) { | 671 | if ( sslerr == SSL_ERROR_SSL ) { |
672 | terminate (STATE_WARNING, _("Client Certificate Required\n")); | 672 | die (STATE_WARNING, _("Client Certificate Required\n")); |
673 | } else { | 673 | } else { |
674 | terminate (STATE_CRITICAL, _("Error in recv()")); | 674 | die (STATE_CRITICAL, _("Error in recv()")); |
675 | } | 675 | } |
676 | } | 676 | } |
677 | else { | 677 | else { |
678 | #endif | 678 | #endif |
679 | terminate (STATE_CRITICAL, _("Error in recv()")); | 679 | die (STATE_CRITICAL, _("Error in recv()")); |
680 | #ifdef HAVE_SSL | 680 | #ifdef HAVE_SSL |
681 | } | 681 | } |
682 | #endif | 682 | #endif |
@@ -684,7 +684,7 @@ check_http (void) | |||
684 | 684 | ||
685 | /* return a CRITICAL status if we couldn't read any data */ | 685 | /* return a CRITICAL status if we couldn't read any data */ |
686 | if (pagesize == (size_t) 0) | 686 | if (pagesize == (size_t) 0) |
687 | terminate (STATE_CRITICAL, _("No data received %s"), timestamp); | 687 | die (STATE_CRITICAL, _("No data received %s"), timestamp); |
688 | 688 | ||
689 | /* close the connection */ | 689 | /* close the connection */ |
690 | my_close (); | 690 | my_close (); |
@@ -708,7 +708,7 @@ check_http (void) | |||
708 | if (verbose) | 708 | if (verbose) |
709 | printf ("STATUS: %s\n", status_line); | 709 | printf ("STATUS: %s\n", status_line); |
710 | 710 | ||
711 | /* find header info and null terminate it */ | 711 | /* find header info and null-terminate it */ |
712 | header = page; | 712 | header = page; |
713 | while (strcspn (page, "\r\n") > 0) { | 713 | while (strcspn (page, "\r\n") > 0) { |
714 | page += (size_t) strcspn (page, "\r\n"); | 714 | page += (size_t) strcspn (page, "\r\n"); |
@@ -732,7 +732,7 @@ check_http (void) | |||
732 | asprintf (&msg, | 732 | asprintf (&msg, |
733 | _("Invalid HTTP response received from host on port %d\n"), | 733 | _("Invalid HTTP response received from host on port %d\n"), |
734 | server_port); | 734 | server_port); |
735 | terminate (STATE_CRITICAL, msg); | 735 | die (STATE_CRITICAL, msg); |
736 | } | 736 | } |
737 | 737 | ||
738 | 738 | ||
@@ -753,7 +753,7 @@ check_http (void) | |||
753 | strstr (status_line, "501") || | 753 | strstr (status_line, "501") || |
754 | strstr (status_line, "502") || | 754 | strstr (status_line, "502") || |
755 | strstr (status_line, "503")) { | 755 | strstr (status_line, "503")) { |
756 | terminate (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line); | 756 | die (STATE_CRITICAL, _("HTTP CRITICAL: %s\n"), status_line); |
757 | } | 757 | } |
758 | 758 | ||
759 | /* client errors result in a warning state */ | 759 | /* client errors result in a warning state */ |
@@ -762,7 +762,7 @@ check_http (void) | |||
762 | strstr (status_line, "402") || | 762 | strstr (status_line, "402") || |
763 | strstr (status_line, "403") || | 763 | strstr (status_line, "403") || |
764 | strstr (status_line, "404")) { | 764 | strstr (status_line, "404")) { |
765 | terminate (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line); | 765 | die (STATE_WARNING, _("HTTP WARNING: %s\n"), status_line); |
766 | } | 766 | } |
767 | 767 | ||
768 | /* check redirected page if specified */ | 768 | /* check redirected page if specified */ |
@@ -778,12 +778,12 @@ check_http (void) | |||
778 | while (pos) { | 778 | while (pos) { |
779 | server_address = realloc (server_address, MAX_IPV4_HOSTLENGTH + 1); | 779 | server_address = realloc (server_address, MAX_IPV4_HOSTLENGTH + 1); |
780 | if (server_address == NULL) | 780 | if (server_address == NULL) |
781 | terminate (STATE_UNKNOWN, | 781 | die (STATE_UNKNOWN, |
782 | _("HTTP UNKNOWN: could not allocate server_address")); | 782 | _("HTTP UNKNOWN: could not allocate server_address")); |
783 | if (strcspn (pos, "\r\n") > (size_t)server_url_length) { | 783 | if (strcspn (pos, "\r\n") > (size_t)server_url_length) { |
784 | server_url = realloc (server_url, strcspn (pos, "\r\n")); | 784 | server_url = realloc (server_url, strcspn (pos, "\r\n")); |
785 | if (server_url == NULL) | 785 | if (server_url == NULL) |
786 | terminate (STATE_UNKNOWN, | 786 | die (STATE_UNKNOWN, |
787 | _("HTTP UNKNOWN: could not allocate server_url")); | 787 | _("HTTP UNKNOWN: could not allocate server_url")); |
788 | server_url_length = strcspn (pos, "\r\n"); | 788 | server_url_length = strcspn (pos, "\r\n"); |
789 | } | 789 | } |
@@ -840,7 +840,7 @@ check_http (void) | |||
840 | asprintf (&msg, _(" - %s - %.3f second response time %s%s|time=%.3f\n"), | 840 | asprintf (&msg, _(" - %s - %.3f second response time %s%s|time=%.3f\n"), |
841 | status_line, elapsed_time, timestamp, | 841 | status_line, elapsed_time, timestamp, |
842 | (display_html ? "</A>" : ""), elapsed_time); | 842 | (display_html ? "</A>" : ""), elapsed_time); |
843 | terminate (onredirect, msg); | 843 | die (onredirect, msg); |
844 | } /* end if (strstr (status_line, "30[0-4]") */ | 844 | } /* end if (strstr (status_line, "30[0-4]") */ |
845 | 845 | ||
846 | 846 | ||
@@ -853,9 +853,9 @@ check_http (void) | |||
853 | status_line, elapsed_time, timestamp, | 853 | status_line, elapsed_time, timestamp, |
854 | (display_html ? "</A>" : ""), elapsed_time); | 854 | (display_html ? "</A>" : ""), elapsed_time); |
855 | if (check_critical_time == TRUE && elapsed_time > critical_time) | 855 | if (check_critical_time == TRUE && elapsed_time > critical_time) |
856 | terminate (STATE_CRITICAL, msg); | 856 | die (STATE_CRITICAL, msg); |
857 | if (check_warning_time == TRUE && elapsed_time > warning_time) | 857 | if (check_warning_time == TRUE && elapsed_time > warning_time) |
858 | terminate (STATE_WARNING, msg); | 858 | die (STATE_WARNING, msg); |
859 | 859 | ||
860 | /* Page and Header content checks go here */ | 860 | /* Page and Header content checks go here */ |
861 | /* these checks should be last */ | 861 | /* these checks should be last */ |
@@ -908,7 +908,7 @@ check_http (void) | |||
908 | asprintf (&msg, _("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n"), | 908 | asprintf (&msg, _("HTTP OK %s - %.3f second response time %s%s|time=%.3f\n"), |
909 | status_line, (float)elapsed_time, | 909 | status_line, (float)elapsed_time, |
910 | timestamp, (display_html ? "</A>" : ""), elapsed_time); | 910 | timestamp, (display_html ? "</A>" : ""), elapsed_time); |
911 | terminate (STATE_OK, msg); | 911 | die (STATE_OK, msg); |
912 | return STATE_UNKNOWN; | 912 | return STATE_UNKNOWN; |
913 | } | 913 | } |
914 | 914 | ||