Is there a way to get CPU usage in CentOS? I need to parse this information and graph it from a Perl script, so it should preferably be a simple tool that prints out one singular output.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I actually use /proc/stat for this.. here’s the important bits of the python I use for my dzen2 widget.
This prints a percentage use of the processor, by the second.
Wrong language, I know, but you should be able to get the gist of which columns of the output refer to what.