summaryrefslogtreecommitdiffstats
path: root/plugins/check_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index ecf61288..1b4bae34 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -726,7 +726,8 @@ check_http (void)
726 726
727 /* Exit here if server_expect was set by user and not default */ 727 /* Exit here if server_expect was set by user and not default */
728 if ( server_expect_yn ) { 728 if ( server_expect_yn ) {
729 msg = ssprintf (msg, "HTTP OK: Status line output matched \"%s\"\n",server_expect); 729 msg = ssprintf (msg, "HTTP OK: Status line output matched \"%s\"\n",
730 server_expect);
730 if (verbose) 731 if (verbose)
731 printf ("%s\n",msg); 732 printf ("%s\n",msg);
732 733
@@ -821,9 +822,9 @@ check_http (void)
821 else if (onredirect == STATE_CRITICAL) 822 else if (onredirect == STATE_CRITICAL)
822 printf ("HTTP CRITICAL"); 823 printf ("HTTP CRITICAL");
823 time (&end_time); 824 time (&end_time);
824 msg = ssprintf (msg, ": %s - %d second response time %s%s\n", 825 msg = ssprintf (msg, ": %s - %d second response time %s%s|time=%d\n",
825 status_line, (int) (end_time - start_time), 826 status_line, (int) (end_time - start_time), timestamp,
826 timestamp, (display_html ? "</A>" : "")); 827 (display_html ? "</A>" : ""), (int) (end_time - start_time));
827 terminate (onredirect, msg); 828 terminate (onredirect, msg);
828 } /* end if (strstr (status_line, "30[0-4]") */ 829 } /* end if (strstr (status_line, "30[0-4]") */
829 830
@@ -833,9 +834,9 @@ check_http (void)
833 834
834 /* check elapsed time */ 835 /* check elapsed time */
835 time (&end_time); 836 time (&end_time);
836 msg = ssprintf (msg, "HTTP problem: %s - %d second response time %s%s\n", 837 msg = ssprintf (msg, "HTTP problem: %s - %d second response time %s%s|time=%d\n",
837 status_line, (int) (end_time - start_time), 838 status_line, (int) (end_time - start_time), timestamp,
838 timestamp, (display_html ? "</A>" : "")); 839 (display_html ? "</A>" : ""), (int) (end_time - start_time));
839 if (check_critical_time == TRUE && (end_time - start_time) > critical_time) 840 if (check_critical_time == TRUE && (end_time - start_time) > critical_time)
840 terminate (STATE_CRITICAL, msg); 841 terminate (STATE_CRITICAL, msg);
841 if (check_warning_time == TRUE && (end_time - start_time) > warning_time) 842 if (check_warning_time == TRUE && (end_time - start_time) > warning_time)
@@ -846,14 +847,14 @@ check_http (void)
846 847
847 if (strlen (string_expect)) { 848 if (strlen (string_expect)) {
848 if (strstr (page, string_expect)) { 849 if (strstr (page, string_expect)) {
849 printf ("HTTP ok: %s - %d second response time %s%s\n", 850 printf ("HTTP ok: %s - %d second response time %s%s|time=%d\n",
850 status_line, (int) (end_time - start_time), 851 status_line, (int) (end_time - start_time),
851 timestamp, (display_html ? "</A>" : "")); 852 timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time));
852 exit (STATE_OK); 853 exit (STATE_OK);
853 } 854 }
854 else { 855 else {
855 printf ("HTTP CRITICAL: string not found%s\n", 856 printf ("HTTP CRITICAL: string not found%s|time=%d\n",
856 (display_html ? "</A>" : "")); 857 (display_html ? "</A>" : ""), (int) (end_time - start_time));
857 exit (STATE_CRITICAL); 858 exit (STATE_CRITICAL);
858 } 859 }
859 } 860 }
@@ -861,15 +862,15 @@ check_http (void)
861 if (strlen (regexp)) { 862 if (strlen (regexp)) {
862 errcode = regexec (&preg, page, REGS, pmatch, 0); 863 errcode = regexec (&preg, page, REGS, pmatch, 0);
863 if (errcode == 0) { 864 if (errcode == 0) {
864 printf ("HTTP ok: %s - %d second response time %s%s\n", 865 printf ("HTTP ok: %s - %d second response time %s%s|time=%d\n",
865 status_line, (int) (end_time - start_time), 866 status_line, (int) (end_time - start_time),
866 timestamp, (display_html ? "</A>" : "")); 867 timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time));
867 exit (STATE_OK); 868 exit (STATE_OK);
868 } 869 }
869 else { 870 else {
870 if (errcode == REG_NOMATCH) { 871 if (errcode == REG_NOMATCH) {
871 printf ("HTTP CRITICAL: pattern not found%s\n", 872 printf ("HTTP CRITICAL: pattern not found%s|time=%d\n",
872 (display_html ? "</A>" : "")); 873 (display_html ? "</A>" : ""), (int) (end_time - start_time));
873 exit (STATE_CRITICAL); 874 exit (STATE_CRITICAL);
874 } 875 }
875 else { 876 else {
@@ -882,9 +883,9 @@ check_http (void)
882#endif 883#endif
883 884
884 /* We only get here if all tests have been passed */ 885 /* We only get here if all tests have been passed */
885 msg = ssprintf (msg, "HTTP ok: %s - %d second response time %s%s\n", 886 msg = ssprintf (msg, "HTTP ok: %s - %d second response time %s%s|time=%d\n",
886 status_line, (int) (end_time - start_time), 887 status_line, (int) (end_time - start_time),
887 timestamp, (display_html ? "</A>" : "")); 888 timestamp, (display_html ? "</A>" : ""), (int) (end_time - start_time));
888 terminate (STATE_OK, msg); 889 terminate (STATE_OK, msg);
889 return STATE_UNKNOWN; 890 return STATE_UNKNOWN;
890} 891}