2015 October 28
2015 September 26
© 2008-2015 David Given, unless specified otherwise

Got any questions? Email me at dg@cowlark.com!
cowlark.com :  System graphs

System graphs

Published: 2015 October 28

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:

These scripts are all in the public domain. Do what thou wilt.