The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-29-2007
Registered User
 

Join Date: May 2007
Posts: 8
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.
Reply With Quote
Forum Sponsor
  #2  
Old 08-30-2007
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
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.
Reply With Quote
  #3  
Old 08-30-2007
Registered User
 

Join Date: Aug 2007
Posts: 45
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 resultsrocesses stats
ps aux :gives some other systemwide results rocesses stats
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
Reply With Quote
  #4  
Old 08-30-2007
Registered User
 

Join Date: May 2007
Posts: 8
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.
Reply With Quote
  #5  
Old 08-31-2007
525SMR's Avatar
Registered User
 

Join Date: Aug 2007
Posts: 1
PerfPMR

Use PerfPRM tool by IBM, untar and use their scripts, either the main one or run them one at a time
Reply With Quote
  #6  
Old 08-31-2007
Registered User
 

Join Date: Sep 2006
Posts: 208
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/
Reply With Quote
  #7  
Old 09-17-2007
Registered User
 

Join Date: Dec 2006
Location: Maryland
Posts: 144
This one is free

Ganglia Monitoring System » Download Ganglia
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0