January 8, 2010

Pretty automatically updating lighttpd server status or “mod_status on steroids”

At work we use the excellent lighttpd (or lighty) web server as a frontend reverse proxy that performs SSL offloading, and  some other neat tricks before our visitors reach our backend servers. It’s been working like a charm.

We’ve been using mod_status to keep track of how much traffic goes through our frontend server. mod_status is one of those little apps that gets the job done but not so much more.

server-status

It contains all the relevant information but I wanted to display this data on a separate monitor to as a way to keep track of how much traffic we where getting in real time.

Since it’s a static html page there wasn’t much interactivity there. So I whipped out my vim-editor and wrote a little helper page that dynamically polls data from the server-status page and displays it in a little more full-screen friendly way. You can see the result below (click on it to enlarge). It will automatically refresh the data once every 5 seconds.

server-status-pretty

Go ahead and download the source. It’s a single html file and all you have to do is to configure your lighty server so that the server status is enabled for a directory to which you’ve got write access to. Ours looks like this:

$SERVER["socket"] == "192.168.30.1:80" {
    status.status-url = "/server-status"
    server.document-root = "/var/www/status"
    mimetype.assign = ( ".html" => "text/html" )
    index-file.names = ( "pretty-status.html" )
}

Then you simply put the file in that page and it should just magically work. Note that the file loads the Google hosted jQuery library so if you don’t have access to the internet (on the machine your viewing from) you’ll have to download the jQuery script and place it along side the page.

Things on the todo list include pretty error messages when the data can’t be fetched and perhaps a nice little demo-mode.

[Download the source], [“Project page at freakcode.com”]

Licensing information

13 comments:

  1. Hi,
    nice, would like to use it but 've got error due to binding on port 80.
    My lighttpd is runing and if I want to use:
    $SERVER["socket"] == "server-ip:80"
    I got an error at lighttpd restart - saying port 80 already in use....

    ReplyDelete
  2. Their seems to be one small problem with this app, since it constantly refreshes itself the ammount of connections increases on every refresh therefore making the logfile larger and making a small amount of traffic. maybe it's not so big of a deal, only b/c I do not know if the logfile deletes itself after getting too large, i can delete it manually every other month i guess.

    ReplyDelete
  3. This is a very cool app. I'm having a good time learning jQuery with it as I extend it to include the server-statistics stats.

    ReplyDelete
  4. Thanks for this - useful and nice to have something that looks a lot nicer, to boot.

    It's just a small point, but the unit of a "byte" has an uppercase B when expressed as a single character and so it should be "GB", "TB", "MB/sec" etc - lowercase "b" is for bits, not bytes.

    Changing b for B on line 241 fixes this unit display issue.

    ReplyDelete
  5. This is not common to seek out wonderful luxury programs intended for such an reasonably priced amount, but the look at marketplace has become incredible a whole lot in past times numerous years this at present different watches are actually not even on the market just for the successful very few. You can receive your advanced seem while not having to pay for amazingly great rates. While you know the way famous people often would like to jump out and stay exclusive? Properly, that so many of them keep going oh no- Breitling running watches really should inform you exactly how excellent they are. Your global recognition will not have an affect on their particular valuation and / or charm in the least! Just after witnessing amazing adult men such as people today donning them all replica omega, it truly is not possible to not ever would like to increase running watches group! This wristwatches, simply because we all believe, usually are some of the sought-after pieces approximately, not only for their appears to be like, but this can stability as well as most significantly http://www.attrinity.com, this perception associated with versatility that offer them. It will make these individuals the leading chosen several of the greatest details all over. This may not be stunning in any case, given that interest in used all through the ages to getting real, solid, plus let us not likely abandon gorgeous replica watches uk, designer watches. But allow me to make it clear at all: My organization is definitely not revealing less expensive imitations that not necessarily stand the opportunity to go shut off because realistic. What i am saying is high end designer watches with an exceptional similarity with the amazing timepieces. But despite that they have got the many traits you are interested in in a very sit back and watch, your incontrovertible advantages is without a doubt the price tag.

    ReplyDelete
  6. Made by maglie a lungo termine dei fornitori Adidas, la casa di Chelsea 2016-2017, via e il terzo maglia presentano il logo del main sponsor Yokohama Rubber per la seconda volta. I giapponesi diventano sponsor di maglia del Chelsea nei primi mesi del 2015, prendendo il posto di Samsung.maglie calcio 2017,
    maglie calcio poco prezzo,
    maglie da calcio a poco prezzo, maglia AC milan online
    Maglia AS Roma 2017

    ReplyDelete




  7. The NFL Flag for Washington Redskins is viewable from both sides with the opposite side being a reverse image.Fly this flag with any of our tailgate poles or 6' aluminum flagpoles and adjustable flag brackets.
    house divided flags,
    nfl american flags,Panthers stars and stripes flags
    Chicago Bears house flags

    ReplyDelete
  8. To increase muscle definition the excess fat in the body should be reduced by following a proper diet suitable for body development. legal steroids dbol reviews

    ReplyDelete