Xymon Mailing List Archive search

Http "forbidden" errors

4 messages in this thread

list Larry Barber · Fri, 9 Jun 2006 08:25:53 -0500 ·
Henrik, I currently have an http test that is getting a "403 Forbidden"
response. Hobbit is not marking this as an error. Would it be possible to
have Hobbit treat a "Forbidden" response as an error and alert on it?

Thanks,
Larry Barber
list Stewart Larsen · Fri, 9 Jun 2006 09:28:53 -0400 ·
I would expect 400 errors to come back yellow and 500 errors to be red. 
quoted from Larry Barber


From: Larry Barber [mailto:user-6ef9c2864140@xymon.invalid] 
Sent: Friday, June 09, 2006 9:26 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Http "forbidden" errors


Henrik, I currently have an http test that is getting a "403 Forbidden"
response. Hobbit is not marking this as an error. Would it be possible
to have Hobbit treat a "Forbidden" response as an error and alert on it?

Thanks,
Larry Barber


Spam
<https://antispam.doh.ad.state.fl.us/canit/b.php?c=s&i=82395813&m=321921
c6947f> 
Not spam
<https://antispam.doh.ad.state.fl.us/canit/b.php?c=n&i=82395813&m=321921
c6947f> 
Forget previous vote
<https://antispam.doh.ad.state.fl.us/canit/b.php?c=f&i=82395813&m=321921
c6947f>
list Frédéric Mangeant · Fri, 09 Jun 2006 15:39:13 +0200 ·
quoted from Larry Barber
Larry Barber a écrit :
Henrik, I currently have an http test that is getting a "403 Forbidden" response. Hobbit is not marking this as an error. Would it be possible to have Hobbit treat a "Forbidden" response as an error and alert on it?

Hi

in bbnet/httpresult.c there's this :

switch(status) {
          case 000:                     /* transportlayer reports error */
                result = (h->dialup ? COL_CLEAR : COL_RED);
                break;
          case 100: /* Continue - should be ok */
          case 200: case 201: case 202: case 203: case 204: case 205: case 206:
          case 301: case 302: case 303: case 307:
          case 401: case 403:           /* Is "Forbidden" an OK status ? */
                result = COL_GREEN;
                break;
          case 400: case 404: case 405: case 406:
                result = COL_RED;       /* Trouble getting page */
                break;
          case 500:
          case 501:
          case 502:  /* Proxy error */
          case 503:
          case 504:
          case 505:
                result = COL_RED;       /* Server error */
                break;


You can modify it and rebuild your Hobbit server.

-- 

Frédéric Mangeant

Steria EDC Sophia-Antipolis
list Henrik Størner · Fri, 9 Jun 2006 16:52:15 +0200 ·
quoted from Larry Barber
On Fri, Jun 09, 2006 at 08:25:53AM -0500, Larry Barber wrote:
Henrik, I currently have an http test that is getting a "403 Forbidden"
response. Hobbit is not marking this as an error. Would it be possible to
have Hobbit treat a "Forbidden" response as an error and alert on it?
Since Frederic has already been quoting my source-code, I guess it's
evident that I have been in doubt about this particular error code.

The reason it does not cause a yellow or red status is that "Forbidden"
is a common result when testing websites that require authentication.
Your Hobbit server may not have the required authentication, and in
that case a red status because of a 403 error would be misleading.

One could also argue that if the server is so much alive as to respond
with a "Forbidden" status, then there is a fair chance that it is 
actually running OK.

So my suggestion is that if you must have a red status if you get a 403
status back, then implement a content-check and look for something in
the response that must be present.


Regards,
Henrik