2

I cannot seem to find a tool that prints LOAD AVERAGE and CPU PERCENT IDLE every X seconds in a terminal window. I am looking for something along the lines of vmstat but with those two values that top shows.

  • What is the main problem you are trying to debug? – Mircea Vutcovici Jun 24 '20 at 21:15
  • An mx server under attack. I block ranges of IPs and everything is fine for a while. So I am basically watching to see when it gets attacked without wanting to overburden it with loads of statistic pings I don't need. – faultintolerant Jun 24 '20 at 22:54

2 Answers2

1

You can use dstat:

dstat -tcl 10
Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83
  • Perfect! Thanks! Would you happen to know why a LOAD AVERAGE of less than 1 is yellow and less than .50 is red? I was working under the impression that a low load average is good and a high load average is bad. There's no MAN entry for this program to explain. – faultintolerant Jun 24 '20 at 21:02
  • 1
    The colors in `dstat` are meade to show variation in data, not to show if there is an error. – Mircea Vutcovici Jun 24 '20 at 21:13
0

vmstat provides measures of load, but only over vmstat's measurement interval, not dampened over time. procs section has counts of runnable and blocked (uninterruptible). Add the two for more or less an instantaneous (Linux) load average.

Over in the cpu column, idle is fairly straight forward.


Why not both? uptime to get the load average and the last reboot. vmstat 5 to watch run queues, paging, and CPU busy. top to sort tasks by CPU or memory.

Healthy load average varies. Much greater load average than the number of CPUs may be a symptom of an overloaded system.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • I couldn't see a relationship between the vmstat procs section and top's load average. I also didn't see any relationship between vmstat idle and top's idle numbers. – faultintolerant Jun 24 '20 at 22:56