
jesus at omniti
Oct 30, 2001, 1:05 PM
Post #2 of 2
(1491 views)
Permalink
|
This seems like it would be tough if your backhand instance is running on a different port that the "advertised" instance. I think it doesn't satisfy a general-enough case to include. I think that writing a perl (and python and PHP and ruby, etc.) Interface to the mod_backhand serverstats shared memory segment would solve all the problems. Then you could do all sorts of really slick stuff in a status page and it wouldn't require editing mod_backhand source -- ugh. It would also open the application up to a little knowledge of cluster-wide resources and a availability. On Tuesday, October 2, 2001, at 03:40 PM, Sean Chittenden wrote: > This is dependent on having your backhand-handler in the same > place on every host and on the same port, but I've found this useful > for moving from host to host and getting both mod_backhand information, > as well as general apache information. Adding a link to a perl, ruby, > and php status page shouldn't be hard, but I haven't found an > aestheticly nice way of doing that yet... or one that's mod_* aware. > > This first patch is only for mod_backhand browsing, the second > is for backhand and server-status. Local configuration dependent > however... -sc > > Index: back_util.c > =================================================================== > RCS file: /storage/cvs/jesus/mod_backhand/back_util.c,v > retrieving revision 1.15 > diff -u -r1.15 back_util.c > --- back_util.c 2001/07/06 01:09:38 1.15 > +++ back_util.c 2001/10/02 19:26:53 > @@ -179,7 +179,8 @@ > tempport); > hostaddress[21] = '\0'; > if(serverstats[i].contact.sin_addr.s_addr!=0) > - ap_rprintf(r, "<TR bgcolor=%s><TD > align=center>%d</TD><TD>%s</TD>\ > + ap_rprintf(r, "<TR bgcolor=%s><TD align=center>%d</TD>\ > +<TD><A href=\"%s://%s:%d%s\">%s</A></TD>\ > <TD align=right>%d</TD><TD align=center>%s</TD><TD align=right>%d</TD>\ > <TD align=left>%d</TD><TD align=center>%d/%d</TD><TD align=center>%d > [%d]</TD>\ > <TD align=right>%d</TD>\ > @@ -187,6 +188,10 @@ > (!is_alive(i,SERVER_TIMEOUT,now))?"#ff4444": > (i%2)?"#aaaaaa":"#cccccc", > i, /* Entry */ > + (r->server->port == 443 ? "https" : "http"), /* > Protocol */ > + serverstats[i].hostname, /* hostname */ > + r->server->port, /* port number */ > + r->unparsed_uri, /* URI */ > serverstats[i].hostname, /* hostname */ > (int)(time(NULL) - serverstats[i].mtime), /* Age */ > hostaddress, /* > aaa.bbb.ccc.ddd:port */ > > > Index: back_util.c > =================================================================== > RCS file: /storage/cvs/jesus/mod_backhand/back_util.c,v > retrieving revision 1.15 > diff -u -r1.15 back_util.c > --- back_util.c 2001/07/06 01:09:38 1.15 > +++ back_util.c 2001/10/02 19:38:36 > @@ -179,16 +179,23 @@ > tempport); > hostaddress[21] = '\0'; > if(serverstats[i].contact.sin_addr.s_addr!=0) > - ap_rprintf(r, "<TR bgcolor=%s><TD > align=center>%d</TD><TD>%s</TD>\ > -<TD align=right>%d</TD><TD align=center>%s</TD><TD align=right>%d</TD>\ > -<TD align=left>%d</TD><TD align=center>%d/%d</TD><TD align=center>%d > [%d]</TD>\ > -<TD align=right>%d</TD>\ > + ap_rprintf(r, "<TR bgcolor=%s><TD align=center>%d</TD>\ > +<TD><A href=\"%s://%s:%d%s\">%s</A></TD>\ > +<TD align=right>%d</TD><TD align=center><A > href=\"%s://%s/server-status/\">%s</A></TD>\ > +<TD align=right>%d</TD><TD align=left>%d</TD><TD > align=center>%d/%d</TD>\ > +<TD align=center>%d [%d]</TD><TD align=right>%d</TD>\ > <TD align=center>%d</TD><TD align=right>%f/%d</TD><TD > align=right>%f</TD></TR>\n", > (!is_alive(i,SERVER_TIMEOUT,now))?"#ff4444": > (i%2)?"#aaaaaa":"#cccccc", > i, /* Entry */ > + (r->server->port == 443 ? "https" : "http"), /* > Protocol */ > serverstats[i].hostname, /* hostname */ > + r->server->port, /* port number */ > + r->unparsed_uri, /* URI */ > + serverstats[i].hostname, /* hostname */ > (int)(time(NULL) - serverstats[i].mtime), /* Age */ > + (r->server->port == 443 ? "https" : "http"), /* > Protocol */ > + hostaddress, /* > aaa.bbb.ccc.ddd:port */ > hostaddress, /* > aaa.bbb.ccc.ddd:port */ > serverstats[i].tmem, /* Total physical > memory */ > serverstats[i].amem, /* Avilable memory */ > > -- > Sean Chittenden > > _______________________________________________ > backhand-devel mailing list > backhand-devel [at] lists > http://lists.backhand.org/mailman/listinfo/backhand-devel > -- Theo Schlossnagle 1024D/82844984/95FD 30F1 489E 4613 F22E 491A 7E88 364C 8284 4984 2047R/33131B65/71 F7 95 64 49 76 5D BA 3D 90 B9 9F BE 27 24 E7
|