Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Measure cpu, memory, network load

Status
Not open for further replies.

blueeyedme

Technical User
Nov 27, 2002
39
NL
Hiya!

It has been a while since i was here, but found this forum again. Again got some great tips.
I have a few machines where i want to measure cpu, memory and network load. Ofcourse i dont want to login every 5 minutes to do top or so ;)
I thought about using a snmp agent to do this, but i prefer to just use a script.
Anybody knows a way to do this to make a nice script that gives me this info?

thanks!!

 
You could write a script that saves the output of:
vmstat 1 6
iostat 1 6
ps -ef -o user,pid,pcpu,pmem,s,args
netstat -i 1 6
<and any other useful commands>

Then 'cut' out (or generate data by manipulation) the information you require and 'echo' it to a file.

Run this script from 'cron' as often as you like.


I hope that helps (to get you started).

Mike
 
On most *nixes, the "[tt]sar[/tt]" command can be used to both collect and report all kinds of system performance and load information without having to hand craft your own scripts.

 
Thanks for the reply's so far. This will help me a bit further :)

 
What version of unix?

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
It will run on Fedora. Two small servers next to all the solaris boxes ;)

 
Since I mainly work on AIX and Linux, I use nmon

I setup a cron job to output the nmon data to file.
Using the nmon_analyser spreadsheet, you can view this data with grapshs etc.
Shows stats on cpu, memory, disks, kernel, top processes etc.etc.

There's also the nmon2rrd tool which will create graphs for web viewing etc.

Awesome tool (even for interactive troubleshooting etc.)


&quot;If you always do what you've always done, you will always be where you've always been.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top