diff options
-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 c947bd87..c9d4d040 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -781,21 +781,21 @@ check_http (void) | |||
781 | pos += (size_t) strcspn (pos, "\r\n"); | 781 | pos += (size_t) strcspn (pos, "\r\n"); |
782 | pos += (size_t) strspn (pos, "\r\n"); | 782 | pos += (size_t) strspn (pos, "\r\n"); |
783 | } /* end while (pos) */ | 783 | } /* end while (pos) */ |
784 | printf ("HTTP UNKNOWN: Could not find redirect location - %s%s", | 784 | printf ("UNKNOWN - Could not find redirect location - %s%s", |
785 | status_line, (display_html ? "</A>" : "")); | 785 | status_line, (display_html ? "</A>" : "")); |
786 | exit (STATE_UNKNOWN); | 786 | exit (STATE_UNKNOWN); |
787 | } /* end if (onredirect == STATE_DEPENDENT) */ | 787 | } /* end if (onredirect == STATE_DEPENDENT) */ |
788 | 788 | ||
789 | else if (onredirect == STATE_UNKNOWN) | 789 | else if (onredirect == STATE_UNKNOWN) |
790 | printf ("HTTP UNKNOWN"); | 790 | printf ("UNKNOWN"); |
791 | else if (onredirect == STATE_OK) | 791 | else if (onredirect == STATE_OK) |
792 | printf ("HTTP ok"); | 792 | printf ("OK"); |
793 | else if (onredirect == STATE_WARNING) | 793 | else if (onredirect == STATE_WARNING) |
794 | printf ("HTTP WARNING"); | 794 | printf ("WARNING"); |
795 | else if (onredirect == STATE_CRITICAL) | 795 | else if (onredirect == STATE_CRITICAL) |
796 | printf ("HTTP CRITICAL"); | 796 | printf ("CRITICAL"); |
797 | elapsed_time = delta_time (tv); | 797 | elapsed_time = delta_time (tv); |
798 | asprintf (&msg, ": %s - %7.3f second response time %s%s|time=%7.3f\n", | 798 | asprintf (&msg, " - %s - %7.3f second response time %s%s|time=%7.3f\n", |
799 | status_line, elapsed_time, timestamp, | 799 | status_line, elapsed_time, timestamp, |
800 | (display_html ? "</A>" : ""), elapsed_time); | 800 | (display_html ? "</A>" : ""), elapsed_time); |
801 | terminate (onredirect, msg); | 801 | terminate (onredirect, msg); |
@@ -826,7 +826,7 @@ check_http (void) | |||
826 | exit (STATE_OK); | 826 | exit (STATE_OK); |
827 | } | 827 | } |
828 | else { | 828 | else { |
829 | printf ("HTTP CRITICAL: string not found%s|time=%7.3f\n", | 829 | printf ("CRITICAL - string not found%s|time=%7.3f\n", |
830 | (display_html ? "</A>" : ""), elapsed_time); | 830 | (display_html ? "</A>" : ""), elapsed_time); |
831 | exit (STATE_CRITICAL); | 831 | exit (STATE_CRITICAL); |
832 | } | 832 | } |
@@ -842,13 +842,13 @@ check_http (void) | |||
842 | } | 842 | } |
843 | else { | 843 | else { |
844 | if (errcode == REG_NOMATCH) { | 844 | if (errcode == REG_NOMATCH) { |
845 | printf ("HTTP CRITICAL: pattern not found%s|time=%7.3f\n", | 845 | printf ("CRITICAL - pattern not found%s|time=%7.3f\n", |
846 | (display_html ? "</A>" : ""), elapsed_time); | 846 | (display_html ? "</A>" : ""), elapsed_time); |
847 | exit (STATE_CRITICAL); | 847 | exit (STATE_CRITICAL); |
848 | } | 848 | } |
849 | else { | 849 | else { |
850 | regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER); | 850 | regerror (errcode, &preg, errbuf, MAX_INPUT_BUFFER); |
851 | printf ("Execute Error: %s\n", errbuf); | 851 | printf ("CRITICAL - Execute Error: %s\n", errbuf); |
852 | exit (STATE_CRITICAL); | 852 | exit (STATE_CRITICAL); |
853 | } | 853 | } |
854 | } | 854 | } |
@@ -887,7 +887,7 @@ int connect_SSL (void) | |||
887 | meth = SSLv23_client_method (); | 887 | meth = SSLv23_client_method (); |
888 | SSL_load_error_strings (); | 888 | SSL_load_error_strings (); |
889 | if ((ctx = SSL_CTX_new (meth)) == NULL) { | 889 | if ((ctx = SSL_CTX_new (meth)) == NULL) { |
890 | printf ("ERROR: Cannot create SSL context.\n"); | 890 | printf ("CRITICAL - Cannot create SSL context.\n"); |
891 | return STATE_CRITICAL; | 891 | return STATE_CRITICAL; |
892 | } | 892 | } |
893 | 893 | ||
@@ -911,7 +911,7 @@ int connect_SSL (void) | |||
911 | ERR_print_errors_fp (stderr); | 911 | ERR_print_errors_fp (stderr); |
912 | } | 912 | } |
913 | else { | 913 | else { |
914 | printf ("ERROR: Cannot initiate SSL handshake.\n"); | 914 | printf ("CRITICAL - Cannot initiate SSL handshake.\n"); |
915 | } | 915 | } |
916 | SSL_free (ssl); | 916 | SSL_free (ssl); |
917 | } | 917 | } |
@@ -939,7 +939,7 @@ check_certificate (X509 ** certificate) | |||
939 | /* Generate tm structure to process timestamp */ | 939 | /* Generate tm structure to process timestamp */ |
940 | if (tm->type == V_ASN1_UTCTIME) { | 940 | if (tm->type == V_ASN1_UTCTIME) { |
941 | if (tm->length < 10) { | 941 | if (tm->length < 10) { |
942 | printf ("ERROR: Wrong time format in certificate.\n"); | 942 | printf ("CRITICAL - Wrong time format in certificate.\n"); |
943 | return STATE_CRITICAL; | 943 | return STATE_CRITICAL; |
944 | } | 944 | } |
945 | else { | 945 | else { |
@@ -951,7 +951,7 @@ check_certificate (X509 ** certificate) | |||
951 | } | 951 | } |
952 | else { | 952 | else { |
953 | if (tm->length < 12) { | 953 | if (tm->length < 12) { |
954 | printf ("ERROR: Wrong time format in certificate.\n"); | 954 | printf ("CRITICAL - Wrong time format in certificate.\n"); |
955 | return STATE_CRITICAL; | 955 | return STATE_CRITICAL; |
956 | } | 956 | } |
957 | else { | 957 | else { |
@@ -980,20 +980,20 @@ check_certificate (X509 ** certificate) | |||
980 | stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min); | 980 | stamp.tm_mday, stamp.tm_year + 1900, stamp.tm_hour, stamp.tm_min); |
981 | 981 | ||
982 | if (days_left > 0 && days_left <= days_till_exp) { | 982 | if (days_left > 0 && days_left <= days_till_exp) { |
983 | printf ("Certificate expires in %d day(s) (%s).\n", days_left, timestamp); | 983 | printf ("WARNING - Certificate expires in %d day(s) (%s).\n", days_left, timestamp); |
984 | return STATE_WARNING; | 984 | return STATE_WARNING; |
985 | } | 985 | } |
986 | if (days_left < 0) { | 986 | if (days_left < 0) { |
987 | printf ("Certificate expired on %s.\n", timestamp); | 987 | printf ("CRITICAL - Certificate expired on %s.\n", timestamp); |
988 | return STATE_CRITICAL; | 988 | return STATE_CRITICAL; |
989 | } | 989 | } |
990 | 990 | ||
991 | if (days_left == 0) { | 991 | if (days_left == 0) { |
992 | printf ("Certificate expires today (%s).\n", timestamp); | 992 | printf ("WARNING - Certificate expires today (%s).\n", timestamp); |
993 | return STATE_WARNING; | 993 | return STATE_WARNING; |
994 | } | 994 | } |
995 | 995 | ||
996 | printf ("Certificate will expire on %s.\n", timestamp); | 996 | printf ("OK - Certificate will expire on %s.\n", timestamp); |
997 | 997 | ||
998 | return STATE_OK; | 998 | return STATE_OK; |
999 | } | 999 | } |