1

I am looking for a command that I can run in a batch mode and report back to a monitoring server. I'd like a CPU usage across all CPUs (the equivalent of running top in interactive mode and then hitting the '1' key). It should work on Mac, Ubuntu and Centos.

I've tried a few commands such as from this post (How do I get an output from Linux Top in Batch Mode on every iteration?)

top -p 310-b -n2 -d 1 | grep -w 310

But it doesn't work on a mac:

invalid option or syntax: -p

Thanks for any help, Kevin

user1130176
  • 173
  • 1
  • 10

1 Answers1

0

However if I prefer to you use a monitoring such as Nagios, But becuae you asked for batch mode, consider the following commands;

  • vmstat
  • sar
  • free
  • iostat
  • pidstat
  • mpstat

Enjoy them...!

PersianGulf
  • 602
  • 8
  • 21