Xymon Mailing List Archive search

4.1.0 Premature end of script headers: /usr2/hobbit//cgi-bin/bb-hostsvc.sh

4 messages in this thread

list Etienne Roulland · Mon, 25 Jul 2005 13:57:52 +0200 ·
Hi,


i have installed hobbit 4.1.0 and get 500 error when i go to a url
like :


http://sphax.exp33.cvf:8080/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=sphax,exp33,cvf.cpu

(as the RSS flow points to these urls).


I got remature end of script headers

but if i go to :

http://sphax.exp33.cvf:8080/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=sphax,exp33,cvf.cpu&IP=10.133.1.29&DISPLAYNAME=sphax.exp33.cvf

it's good

(Got no problems with 4.0.4).

Rgds,

-- 
Etienne Roulland -- CVF Bordeaux
list Henrik Størner · Mon, 25 Jul 2005 15:20:33 +0200 ·
quoted from Etienne Roulland
On Mon, Jul 25, 2005 at 01:57:52PM +0200, Etienne Roulland wrote:
i have installed hobbit 4.1.0 and get 500 error when i go to a url
like :

http://sphax.exp33.cvf:8080/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=sphax,exp33,cvf.cpu
Thanks, that is a bug. Doesn't happen normally, since all the URL's
generated by Hobbit include the extra parameters.

This patch should solve it.


Henrik

-------------- next part --------------
--- hobbitd/hobbitsvc.c	2005/07/22 10:07:25	1.45
+++ hobbitd/hobbitsvc.c	2005/07/25 13:17:56
@@ -10,7 +10,7 @@
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
 
-static char rcsid[] = "$Id: hobbitsvc.c,v 1.45 2005/07/22 10:07:25 henrik Exp $";
+static char rcsid[] = "$Id: hobbitsvc.c,v 1.46 2005/07/25 13:17:45 henrik Exp $";
 
 #include <limits.h>
 #include <stdio.h>
@@ -140,6 +140,7 @@
 	char *restofmsg = NULL, *ackmsg = NULL, *dismsg = NULL;			/* These are just used */
 	int ishtmlformatted = 0;
 	int clientavail = 0;
+	namelist_t *hinfo = NULL;
 
 	if (parse_query() != 0) return 1;
 
@@ -148,11 +149,14 @@
 		lastload = now;
 	}
 
-	if (!hostinfo(hostname)) {
+	if ((hinfo = hostinfo(hostname)) == NULL) {
 		errormsg("No such host");
 		return 1;
 	}
 
+	if (!ip) ip = strdup(bbh_item(hinfo, BBH_IP));
+	if (!displayname) displayname = strdup(hostname);
• if (outform == FRM_CLIENT) {
 		char hobbitdreq[200];
 		int hobbitdresult;
@@ -343,9 +347,9 @@
 	else {
 		fprintf(stdout, "Content-type: text/html\n\n");
 		generate_html_log(hostname, 
-			  (displayname ? displayname : hostname), 
+			  displayname,
 			  service, 
-			  (ip ? ip : ""), 
+			  ip,
 		          color, 
 			  (sender ? sender : "Hobbit"), 
 			  (flags ? flags : ""),
list Etienne Roulland · Mon, 25 Jul 2005 15:55:01 +0200 ·
quoted from Etienne Roulland
On Mon, Jul 25, 2005 at 01:57:52PM +0200, Etienne Roulland wrote:
i have installed hobbit 4.1.0 and get 500 error when i go to a url
like :

http://sphax.exp33.cvf:8080/hobbit-cgi/bb-hostsvc.sh?HOSTSVC=sphax,exp33,cvf.cpu
Thanks, that is a bug. Doesn't happen normally, since all the URL's
generated by Hobbit include the extra parameters.

This patch should solve it.
Yep it solved it.

But i'm still not able to get my SQL graphes.. :-(

Etienne
list Henrik Størner · Mon, 25 Jul 2005 16:00:02 +0200 ·
quoted from Etienne Roulland
On Mon, Jul 25, 2005 at 03:55:01PM +0200, Etienne Roulland wrote:
This patch should solve it.
Yep it solved it.

But i'm still not able to get my SQL graphes.. :-(
I think your data is being picked up OK, it's just getting
the graphs done right. However, I won't have time to look at
it until next week, I'm afraid.


Henrik