add status_line to check_http output

This commit is contained in:
Jan Wagner 2008-06-19 14:06:58 +00:00
parent f56b6b97f5
commit ac38a0f73a
2 changed files with 32 additions and 0 deletions

7
debian/changelog vendored
View file

@ -1,3 +1,10 @@
nagios-plugins (1.4.12-2) UNRELEASED; urgency=low
* add 40_check_http_status_line.dpatch to add content of the status_line
into the check_http output (Closes: #486932)
-- Jan Wagner <waja@cyconet.org> Wed, 18 Jun 2008 13:53:00 +0200
nagios-plugins (1.4.12-1) unstable; urgency=low
[ Jan Wagner ]

View file

@ -0,0 +1,25 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 40_check_http_status_line.dpatch by Jan Wagner <waja@cyconet.org>
## patch provided by Josip Rodin <joy@debbugs.entuzijast.net>
##
## DP: adds status_line to check_http output
@DPATCH@
--- check_http.c~ 2008-06-19 11:42:25.000000000 +0200
+++ check_http.c 2008-06-19 11:42:25.000000000 +0200
@@ -912,11 +912,12 @@
if (!strstr (status_line, server_expect)) {
if (server_port == HTTP_PORT)
asprintf (&msg,
- _("Invalid HTTP response received from host\n"));
+ _("Invalid HTTP response received from host: %s\n"),
+ status_line);
else
asprintf (&msg,
- _("Invalid HTTP response received from host on port %d\n"),
- server_port);
+ _("Invalid HTTP response received from host on port %d: %s\n"),
+ server_port, status_line);
die (STATE_CRITICAL, "%s", msg);
}