Xymon Mailing List Archive search

HTTP error 0

list T.J. Yang
Fri, 14 Nov 2008 07:10:12 -0600
Message-Id: <user-79d884f949f3@xymon.invalid>


From: "Aaron Li" <user-deffebe7d884@xymon.invalid>
Sent: Friday, November 14, 2008 12:15 AM
To: <user-ae9b8668bcde@xymon.invalid>
Subject: RE: [hobbit] HTTP error 0
Actually, we use hobbit in our US company, sorry I can't list our company 
name here.
no problem, same here.

tj
Aaron.Li


-----Original Message-----
From: T.J. Yang [mailto:user-8e841282cda5@xymon.invalid]
Sent: Friday, November 14, 2008 10:52 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] HTTP error 0

Would you mind to  make an entry of your Xymon usage at here ?

http://en.wikibooks.org/wiki/System_Monitoring_with_Xymon/User_Guide/The_Xymon_Users_list

Your entry  first entry from China.

tj yang

From: "Aaron Li" <user-deffebe7d884@xymon.invalid>
Sent: Thursday, November 13, 2008 8:37 PM
To: <user-ae9b8668bcde@xymon.invalid>
Subject: RE: [hobbit] HTTP error 0
Thanks a lot for all your help


Aaron.Li


-----Original Message-----
From: Samuel Cai [mailto:user-ba507acc1d03@xymon.invalid]
Sent: Thursday, November 13, 2008 6:37 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] HTTP error 0

Thank you Henrik, this is the root cause!
We did not install openssl dev package, the "bbtest-net --version"
only returns hobbit version.
After we installed and recompile, problem is gone!

Thanks again.

Samuel Cai

-----Original Message-----
From: Henrik "Størner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Thursday, November 13, 2008 2:56 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] HTTP error 0

In <user-543359c918a2@xymon.invalid>
"Samuel Cai" <user-ba507acc1d03@xymon.invalid> writes:
In <user-7bd96d8c477b@xymon.invalid>
= "Aaron Li" <user-deffebe7d884@xymon.invalid> writes:
When hobbit monitors the https site, it always gets the error " HTTP
error 0" like below, I appreciate a lot if anyone can give the =
solution,
I'm with Aaron in same company, the weird thing is, if we use wget,
then =
can still receive data, so not sure what's wrong.

Can you try running '~hobbit/server/bin/bbtest-net --version' just to
check the version number of your OpenSSL library ?

And can you get data using just the openssl client utility ? Like this:

 openssl s_client -connect 10.20.30.40:443

(replace the IP with that of your server). If that succeeds and shows
you the server certificate then enter

 GET / HTTP/1.0

and hit <enter> twice - this mimicks a simple HTTP request. Does that
work ? And how long does it take to complete ?


Finally, you could try modifying the code in
hobbit-4.2.0/bbnet/contest.c In there is a routine called
"socket_read"; delete the version in your file and replace it with the
version below. Recompile with "make bbnet-build"
and copy the new bbnet/bbtest-net program to ~hobbit/server/bin/ .
Then run it with the "--debug" option enabled, like

  bbcmd bbtest-net --noping --debug HOSTNAME

to run the test of just this one host. Hopefully that will print out
some more info about what happens with that read that returns -1.


Regards,
Henrik


static int socket_read(tcptest_t *item, char *inbuf, int inbufsize) {
       int res = 0;
       char errtxt[1024];

       if (item->svcinfo->flags & TCP_SSL) {
               if (item->sslrunning) {
                       item->sslagain = 0;
                       res = SSL_read(item->ssldata, inbuf, inbufsize);
                       if (res < 0) {
                               switch (SSL_get_error (item->ssldata,
res)) {
                                 case SSL_ERROR_WANT_READ:
                                 case SSL_ERROR_WANT_WRITE:
                                         item->sslagain = 1;
                                         break;
                                 default:

ERR_error_string(ERR_get_error(), errtxt);
                                         dbgprintf("SSL read error
%s\n", errtxt);
                                         break;
                               }
                       }
               }
               else {
                       /* SSL setup failed - flag 0 bytes read. */
                       res = 0;
               }
       }
       else {
               res = read(item->fd, inbuf, inbufsize);
               if (res < 0) {
                       dbgprintf("Read error %s\n", strerror(errno));
               }
       }

       if (res > 0) item->bytesread += res;
       return res;
}