Here are some graphs showing the status of some of cowlark.com's hardware. Enjoy.
I've had some requests as to how I did these graphs. They're done as follows:
- Every minute a cron job polls the state of the UPS and the system stats, and stores the result in an RRD database.
- Every ten minutes another cron job uses RRDtool's built-in grapher to update the images above. The web server then serves these as static images (so no CGI script is necessary).
It's not perfect --- mainly because I haven't yet figured out a way to get lighttpd to produce the relevant headers to tell the user's web browser that the images will expire in ten minutes --- but it's nicely lightweight and doesn't require any web server integration.
The UPS is a very cheap Liebert PSA 350, connected via USB, and then I run NUT on the server to talk to it. NUT doesn't like it much, and I have to run NUT 2.4.3 rather than the current version, 2.6, because otherwise it won't connect. Also, the UPS' idea of battery runtime is way off. The graph above claims about 100 minutes --- it's more like 45. And if the power does go off, the charge slowly drops from 100% to 90% and then to 0% in the space of two minutes. I suspect that my 18W setup is confusing its ability to measure current. On the other hand, given that the device is supposed to run a full-sized PC for five minutes, I reckon that's pretty good.
The scripts I'm using are linked to below. They may or may not be of use to people:
make-ups-rrd (677 bytes)
This script creates the RRD databases. I have no real idea what all the settings mean; this is just copied from the example documentation. I'm using three different databases instead of one because I added the system load and network throughput later and didn't want to lose the UPS data.
update-ups-rrd (553 bytes)
This one polls the UPS, the system load and the network throughput, and writes the result to the RRD database. This runs every minute. Lots of hideous awk-based data parsing in here.
update-rrd-graph (2.6 kB)
And this one, which runs every ten minutes, pulls the data out of the RRD database and draws the graphs.
These scripts are all in the public domain. Do what thou wilt.