<div class="gmail_quote">On Wed, Jun 24, 2009 at 10:55 PM, T.J. Yang <span dir="ltr"><<a href="mailto:tj_yang@hotmail.com">tj_yang@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
----------------------------------------<br>
> Date: Wed, 24 Jun 2009 18:42:17 -0600<br>
> From: <a href="mailto:asparks@doublesparks.net">asparks@doublesparks.net</a><br>
> To: <a href="mailto:hobbit@hswn.dk">hobbit@hswn.dk</a><br>
> Subject: Re: [hobbit] Debugging issues with bb-histlog.sh on 4.3.0<br>
<div class="im">><br>
> Ralph Mitchell wrote:<br>
>> On Wed, Jun 24, 2009 at 7:24 PM, Alan Sparks<br>
</div><div class="im">>>> wrote:<br>
>><br>
>> T.J. Yang wrote:<br>
>>> I am experiencing same problem but it is on a 4.2.0 server.<br>
>>> If you like, we can work together to debug this issue.<br>
>>> This bug is listed on my hobbit deployment todo list .<br>
>>><br>
>>> --------------------------------------------------<br>
>>> From: "Alan Sparks"<br>
>>><br>
</div><div class="im">>>>> I've some "random" failures on bb-histlog.sh, viewing items in<br>
>> the bb2<br>
>>>> event log. Some work as expected, but some when clicked appear<br>
>> to do<br>
>>>> nothing. Hitting the URL for that (say<br>
>>>><br>
>> <a href="http://den2sch17/hobbit-cgi/bb-histlog.sh?HOST=den1ws063&SERVICE=nfs&TIMEBUF=Mon_Jun_22_18:46:39_2009" target="_blank">http://den2sch17/hobbit-cgi/bb-histlog.sh?HOST=den1ws063&SERVICE=nfs&TIMEBUF=Mon_Jun_22_18:46:39_2009</a><br>

</div><div class="im">>> )<br>
>>>><br>
>>>> with curl shows a zero-length reply. Checking the Apache error log<br>
>>>> shows "Premature end of script headers: bb-histlog.sh, referer:<br>
>>>> <a href="http://den2sch17/hobbit/bb2.html" target="_blank">http://den2sch17/hobbit/bb2.html</a>". I have found no core files left<br>
>>>> behind.<br>
>>>><br>
>> Well, I have mixed luck running under GDB... looking at the code,<br>
>> saw it<br>
>> was trying to get the CGI info from the environment so set some<br>
>> environment variables to fake up enough CGI environment to get it to<br>
>> run. But mostly wound up getting segfaults in expand_env on the<br>
>> HTMLCONTENTTYPE stuff.<br>
>><br>
>> But I stumbled upon something that fixed my problem -- but not sure<br>
>> why. I edited the cgi-bin/bb-histlog.sh file, and added<br>
>> "cd /tmp" before the meat of the script. For some reason, I now<br>
>> seem to<br>
>> have no issues.<br>
>><br>
>><br>
>> Perhaps that ought to be "cd $BBTMP" instead?? Keep all Xymon stuff<br>
>> in one place.<br>
>><br>
>> Ralph Mitchell<br>
>><br>
> BBTMP is not defined when this script runs...<br>
<br>
</div>Following is my debugging of my hobbit server implementation(using slightly different paths).<br>
bb-hostsvc.sh has two lines of code.<br>
1. ". /etc/opt/hobbitserver42/hobbitcgi.cfg"<br>
2. "exec /opt/hobbitserver42/bin/hobbitsvc.cgi $CGI_SVC_OPTS"<br>
<br>
$CGI_SVC_OPTS variable got declared in hobbitcgi.cfg as following<br>
<br>
CGI_SVC_OPTS="--env=/etc/opt/hobbitserver42/hobbitserver.cfg --no-svcid --history=top"<br>
and in hobbitserver.cfg, BBTMP is declared also.<br>
<br>
So I don't see why declaring BBTMP can help. but I did go ahead and re-declared BBTMP variable in bb-histlog.sh. The premature error message still showing in apache error_log file.<br>
And I do see a core file under cig-bin and file command shows it is from hobbitsvc.cgi command.</blockquote><div><br></div><div>But did you cd to $BBTMP as well as redefining it??  The only reason I mentioned it was that Alan reported that "cd /tmp" made it work.  I just thought it would be better to cd into a place the Xymon owns.</div>
<div><br></div><div>Ralph Mitchell</div><div><br></div></div>