3

Is there some way to monitor my CPU usage over a period of time, e.g. get a graph that shows CPU% vs. date/time? I occasionally see high load using htop, but I'd like to see what's happening throughout the day.

The more lightweight, the better :)

user967722
  • 247
  • 1
  • 4
  • 5

2 Answers2

6

There's nmon for Linux which is in Ubuntu build. You can run nmon in 'spreadsheet' mode where it samples data every few minutes and saves it to a file. There are various tools for then graphing that, or you can just review the data manually.

More complex options include things like munin, cacti, etc. but they look at just more than straight CPU.

EightBitTony
  • 9,211
  • 1
  • 32
  • 46
  • Checkout https://sealion.com. Another free tool doing the same. Easy to setup and has a convenient interface to view the output. – Vishal Dec 24 '13 at 09:42
  • It is worth mention that in case you use the GUI, use the `c` option to view current CPU usage,or the `l` option to view the CPU usage over time (along a time "axis"). – Guy Avraham Jul 04 '18 at 10:40
2

The command sar is intended to do this and should be available by default under Ubuntu as the sysstat package.

It's output is plain-text rather than graphical, but kSar is intended to take this data and make it pretty for you. This may need to be built or found in an unsupported repository. (I don't know.)

nixCraft did a great write up on the tool you may want to refer to for more information.

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67