Ed Greenberg <[email protected]> wrote: > I rolled my own as follows: > > 1. I turned on server-status and ExtendedStatus > > 2. I wrote a script to retrieve http://localhost/server-status?auto > which returns this: > Total Accesses: 123048 > Total kBytes: 1445888 > CPULoad: .270592 > Uptime: 20688 > ReqPerSec: 5.9478 > BytesPerSec: 71567.5 > BytesPerReq: 12032.6 > BusyWorkers: 4 > IdleWorkers: 71 > Scoreboard: ........ > > I wrote a script to use gmetric to pump the values above (those I want) > into ganglia. (Available on request.)
What I did included that, plus some more things. My "webstats" script runs from cron once a minute, and gets the scoreboard information from Apache's server-status and puts it into Ganglia via gmetric. I added an Apache logfile with this custom format: LogFormat "%t %m %f \"%q\" %s %b %D" I wrote a daemon that watches that logfile (a real daemon, also with a chkconfig compatible init script) and runs gmetric once a minute with a bunch of per-minute stats, including total queries per minute, and timing information by decile (10% of pages took this many ms or less, 20% of pages took this many ms or less, etc.) and, optionally, by page, and mean & median page serve times. I also have a netconncnt script that I use for several things, which takes a list of well known ports (such as 80) on the command line and counts number of network connections corrently open on that port, inbound and outbound, by TCP status. On web servers, I run that from cron once a minute as "netconncnt 80" and have a graph of http connections to the web server broken down by established, syn_sent, time_wait, etc. I also wrote a bunch of custom graphs like that, for the page serve times, pages per second, scoreboard, etc, and modified Ganglia-web to show some of those graphs on the cluster pages for each web cluster (I sent out a patch for per-cluster graph lists a couple of months ago to this list). I packaged up the above scripts and daemon, associated config files, cron file, and graphs, into an RPM that I put in our local yum repo. So, once you've got Ganglia installed on a web server, you just do "yum install webmeter", edit the conf file, add the custom log to the httpd.conf (which can be in your config management), and start it up with "chkconfig webmeter on; service webmeter start". Conf file is shared by all the scripts. It sets the user/pass and hostname for your /server-status, location of custom Apache log, and a list of pages to exclude from counting and timing stats (such as, for example, /server-stats :) -- Cos ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general

