![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CPU, memory and disk stats | ungnown.admin | SUN Solaris | 6 | 05-14-2008 04:00 PM |
| system stats | rocker40 | AIX | 2 | 04-14-2008 07:24 AM |
| NFS performance stats on Linux | sysgate | Linux | 1 | 04-16-2007 05:21 AM |
| I/O Stats Metrics | LivinFree | UNIX for Advanced & Expert Users | 0 | 06-06-2006 09:38 PM |
| Display filename and wc stats | asianmike | UNIX for Dummies Questions & Answers | 1 | 04-12-2006 01:51 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
can I use ps to log overall system stats.
Hi I'm writing a script to get overall system memory and cpu utilization in percentages, much like in top or with AIX's topas.
Could I use 'ps' to get the same, I know I can get such results for a particular or group of PIDs but I haven't been able to figure out how I could use 'ps' to give me general system wide stats Is there some other utility I could incorporate in to my script so that I may dump this info into a csv sort of file. This need to work on AIX 5.2 & 5.3 Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Sorry for not answering for "ps" question, I don't have man pages installed on my aix boxes (I know, this is stupid), but I will recommend this tool for gathering such info - get the source code and build it, it's awesome tool, plus it has the csv reporting option that you asked about. If someone has thoughts to share for the "ps" question, I will be glad to learn it too.
|
|
#3
|
|||
|
|||
|
if you have man pages in your system you look at this ;
vmstat 1 20 :gives virtual memory stats. 20 times 1 is the period (1 second) or vmstsat 1 or else ps -ef :gives systemwide results ps aux :gives some other systemwide results sar 1 1 or sar -P ALL etc sar gives cpu stats ( vmstat gives this information additionally to memory stats. But sar gives detailed info for all cpu ) netstat -v |netstat -D |netstat -i|netstat -r |netstat -in or etc.gives networtk stats iostat 1 10 gives io stats filemon gives filesystem stats topas uses this underneath : sou you must read these from man pages |
|
#4
|
|||
|
|||
|
Hi, I'm looking into that tool sysgate, my corporate firewall (sonic) had it blocked so I'm in the process of getting that opened up, I'm quite interested from your description. I ended up using vmstat and iostat, though the better option would have been 'sar'. It relies on a few services to populate a file with sa1 and sa2, it's in the manual, unfortunately I couldn't get the time to configure it, I went with a simple script for the time being till the site opens up:
#!/bin/bash # applabs.com # Author: Siddharth Mody (siddharth.mody@gmail.com) #===============START=============== ROOT_UID=0 # only users with $UID 0 have root privilages. E_NOROOT=67 # Non-root exit error. FILENAME=$1-${BACKUPDATE}".mem" #check if root user. # Run as root: if [ "$UID" -ne "$ROOT_UID" ] then echo "Must be root to run this script" exit $E_NOTROOT fi; testrun=$1; # start timer while true do read_time=$(date +%m.%d.%Y-%H\:%M\:%S); # used and free memory pages of 4k chunks avm=$(vmstat | awk '{print $3}' | tail -n 1); fre=$(vmstat | awk '{print $4}' | tail -n 1); cpu=$(iostat -s | awk '{print $4}' ); read -r -a array <<< $cpu; cpu=${array[2]}; logdata=${cpu}","${avm} mainheader="time,pcpu,pmem(4k chunks)"; if [ -f ${testrun}"_sysMon.csv" ] then : else echo "["$(uname -a)"]" >> ${testrun}"_sysMon.csv" echo "${mainheader}" >> ${testrun}"_sysMon.csv" fi #log data into file echo ${read_time}; echo ${read_time}","${logdata} >> ${testrun}"_sysMon.csv" sleep 15 done exit 0 If anybody could tell me how to manage that data extraction using awk with specifying line numbers I could get rid of all those read and tail statements. Thanks for all the help so far, I really appreciate this forum. |
|
#5
|
||||
|
||||
|
PerfPMR
Use PerfPRM tool by IBM, untar and use their scripts, either the main one or run them one at a time
|
|
#6
|
|||
|
|||
|
PerfPMR is, strictly speaking, version specific but you may be able to parse the v5.2 and v5.3 releases and find common scripts to achieve your goal.
Details: pSeries and AIX Information Center Download: ftp://ftp.software.ibm.com/aix/tools/perftools/perfpmr/ |
|
#7
|
|||
|
|||
| Google The UNIX and Linux Forums |