[hobbit] Debugging issues with bb-histlog.sh on 4.3.0

T.J. Yang tj_yang at hotmail.com
Thu Jun 25 13:28:12 CEST 2009



________________________________
> Date: Wed, 24 Jun 2009 23:16:39 -0500
> From: ralphmitchell at gmail.com
> To: hobbit at hswn.dk
> Subject: Re: [hobbit] Debugging issues with bb-histlog.sh on 4.3.0
>
> On Wed, Jun 24, 2009 at 10:55 PM, T.J. Yang> wrote:
>
> ----------------------------------------
>
>> Date: Wed, 24 Jun 2009 18:42:17 -0600
>
>> From: asparks at doublesparks.net
>
>> To: hobbit at hswn.dk
>
>> Subject: Re: [hobbit] Debugging issues with bb-histlog.sh on 4.3.0
>
>>
>
>> Ralph Mitchell wrote:
>
>>> On Wed, Jun 24, 2009 at 7:24 PM, Alan Sparks
>
>>>> wrote:
>
>>>
>
>>> T.J. Yang wrote:
>
>>>> I am experiencing same problem but it is on a 4.2.0 server.
>
>>>> If you like, we can work together to debug this issue.
>
>>>> This bug is listed on my hobbit deployment todo list .
>
>>>>
>
>>>> --------------------------------------------------
>
>>>> From: "Alan Sparks"
>
>>>>
>
>>>>> I've some "random" failures on bb-histlog.sh, viewing items in
>
>>> the bb2
>
>>>>> event log. Some work as expected, but some when clicked appear
>
>>> to do
>
>>>>> nothing. Hitting the URL for that (say
>
>>>>>
>
>>> http://den2sch17/hobbit-cgi/bb-histlog.sh?HOST=den1ws063&SERVICE=nfs&TIMEBUF=Mon_Jun_22_18:46:39_2009
>
>
>>> )
>
>>>>>
>
>>>>> with curl shows a zero-length reply. Checking the Apache error log
>
>>>>> shows "Premature end of script headers: bb-histlog.sh, referer:
>
>>>>> http://den2sch17/hobbit/bb2.html". I have found no core files left
>
>>>>> behind.
>
>>>>>
>
>>> Well, I have mixed luck running under GDB... looking at the code,
>
>>> saw it
>
>>> was trying to get the CGI info from the environment so set some
>
>>> environment variables to fake up enough CGI environment to get it to
>
>>> run. But mostly wound up getting segfaults in expand_env on the
>
>>> HTMLCONTENTTYPE stuff.
>
>>>
>
>>> But I stumbled upon something that fixed my problem -- but not sure
>
>>> why. I edited the cgi-bin/bb-histlog.sh file, and added
>
>>> "cd /tmp" before the meat of the script. For some reason, I now
>
>>> seem to
>
>>> have no issues.
>
>>>
>
>>>
>
>>> Perhaps that ought to be "cd $BBTMP" instead?? Keep all Xymon stuff
>
>>> in one place.
>
>>>
>
>>> Ralph Mitchell
>
>>>
>
>> BBTMP is not defined when this script runs...
>
>
>
> Following is my debugging of my hobbit server implementation(using slightly different paths).
>
> bb-hostsvc.sh has two lines of code.
>
> 1. ". /etc/opt/hobbitserver42/hobbitcgi.cfg"
>
> 2. "exec /opt/hobbitserver42/bin/hobbitsvc.cgi $CGI_SVC_OPTS"
>
>
>
> $CGI_SVC_OPTS variable got declared in hobbitcgi.cfg as following
>
>
>
> CGI_SVC_OPTS="--env=/etc/opt/hobbitserver42/hobbitserver.cfg --no-svcid --history=top"
>
> and in hobbitserver.cfg, BBTMP is declared also.
>
>
>
> 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.
>
> And I do see a core file under cig-bin and file command shows it is from hobbitsvc.cgi command.
>
> 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.

1. following change still generate Premature errors.

BBTMP=/var/opt/hobbitserver42/tmp
cd ${BBTMP}
. /etc/opt/hobbitserver42/hobbitcgi.cfg
exec /opt/hobbitserver42/bin/hobbitsvc.cgi $CGI_SVC_OPTS
2. Tracing the src code now
http://hobbitmon.svn.sourceforge.net/viewvc/hobbitmon/branches/4.2.0/web/Makefile?view=markup
HOBBITSVCOBJS   = hobbitsvc.o hobbitsvc-info.o hobbitsvc-trends.o
hobbitsvc.cgi is from hobbitsvc.c hobbitsvc-info.c hobbitsvc-trends.c.

tj

>
> Ralph Mitchell
>

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009


More information about the Xymon mailing list