Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am working on a way of monitoring if my machine´s preformance since I am afraid the cpu wont be sufficient for the work its supposed to do..
What I basically wanto do is make some form of script/program/crontab job that:
1) gets current CPU-load (total all users), mem-usage and swap-usage
2) opens a file, puts this at last line, saves the file..
Then i can show this very nicely on some webpage using php or the like.
So I pretty much need help with what commands to use or how, then throwing it in a file for easier handling.
Aha there you go, putting the info into a file seemed a bit easier then I expected, all that is left is the nifty command that gives me all the info I need.. the search continues
note: ive found that uptime seems to give 3 values after "load average", but havent had time to read more about this, could be the golden command if its cpu and mem-usage, then that could be enough for me
Thanks lugoteehalt !
Edit: seems uptime only gives you cpu-usage, no mem or swap stats.
Did you try "top"? Top shows a lot of info.
But with top you will need some special arguments in order to make it behave correctly. Top won't exit until you tell him to exit. So, you have to issue the number of iterations top will perform.
top -n 1 >> topinfo.txt
Using two > chars, the command will append the new text into the file, whitout erasing the current content. Using only one, top will erase all prior content and paste new, each time you run the script. (like this: top -n 1 > topinfo.txt)
Hope it helps!
Last edited by bruno buys; 04-30-2004 at 12:36 PM.
I think top takes a bit to much out of the cpu, if I "run" it, without the -n 1, it takes about 0.1-20% cpu, I dont want something going off every 5th minute causing any form of preformance-decrease...
Maybe if I can get it to show without the actual PID-info and just the interesting info at the "top" () it will be very nice, from that I can just extract anything I want/need since its all there!
If you have sysstat installed you could use sar
blink@insanity ~--> sar -u 10 5
Linux 2.4.20-30.9 (insanity) 05/14/2004
09:33:39 AM CPU %user %nice %system %idle
09:33:49 AM all 9.70 0.10 1.20 89.00
09:33:59 AM all 7.40 0.10 0.50 92.00
09:34:09 AM all 8.30 0.40 1.20 90.10
09:34:19 AM all 6.60 0.20 0.70 92.50
09:34:29 AM all 18.50 0.00 0.90 80.60
Average: all 10.10 0.16 0.90 88.84