2

When I run uptime, I get output similar to the following:

 07:50:39 up 13 days,  5:00,  1 user,  load average: 0.00, 0.02, 0.00

Is there a way, other than by running uptime every X-many minutes, to get a more historical load average?

I'd like to be able to graph the load averages across the last week, month, etc.

Perhaps I'm looking in the wrong place?

Update
I can't choose between collectd (@david spillet) or munin (@icapan) - so for now, I'll use both (on different machines).

Thanks :)

warren
  • 17,829
  • 23
  • 82
  • 134

4 Answers4

5

I use collectd to record system load amongst a number of other parameters. It stores the data in RRD stores that can be graphed and otherwise analysed using the many available tools and scripts. I use a modified version of this script for my graphing (sample output).

Collectd has plugins for monitoring lots of stuff (everything commonly asked for and a few things on top), and creating your own shouldn't be difficult if you need something specialised, so makes for a very flexible tool. Configuring the graphs in rrd.cgi is a very manual process, though not difficult, though you might well find a more convenient tool for working with the RRD files maintained by collectd.

David Spillett
  • 22,534
  • 42
  • 66
5

Munin is the easiest way to get uptime graphs with minimum effort in installing and configuring. I also use atop for aggregate cpu usage by some process, but that is not what You asked for.

Icapan
  • 484
  • 1
  • 3
  • 9
2

Look at man sadc (System activity data collector) and man sar (Collect, report, or save system activity information).

On my Ubuntu system, all I had to do to enable data collections, since the cron job was already in place, was edit /etc/default/sysstat and change this line to "true":

ENABLED="true"

To display load information similar to uptime, do:

sar -q

To display default output for a particular time range and date (here, the 20th of the month):

sar -s 11:00:00 -e 14:00:00 -f /var/log/sysstat/sa20
Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
0

Load average data can be found in /proc/loadavg pseudo-file. The format there is maybe more suitable for an automatic processing. Apart from the format, these are exactly the same numbers as those you receive when you execute the uptime command.

Once ago, to solve a problem similar to yours, I just scheduled a bash script with cron to read /proc/loadavg and issue a rrdtool update command to update a RRD database.

rolaf
  • 558
  • 1
  • 3
  • 8
  • running cron every minute would certainly work, but I'm hoping to accomplish this without something so.. laborious :) – warren Sep 22 '09 at 06:29