Performance Testing, LoadRunner Tips&Tricks

This site is moving to a bigger space @ LoadRunner TnT

Tools: Monitoring Unix Resource Script ver 1.0

Due to the past experiences working in my organization, having the problem of not able to monitor the Unix system resources due to whatever reasons (rstatd configuration, dynamic ports, security reasons or lazy administrators) had always been bothering us.

Our team came up with the simple initiative to monitor using the same concept as perfmon. We requested (outsourced) one of our interims to search for unix monitoring scripts and modify it to collect data periodically. And here we are, special thanks to the interim, we finally got the first-cut of the scripts.

Copy and paste the below script starting from here ==================================================================

# (C) 2006 Mark Boddington,

# (C) 2007 Modified by Hwee Seong,
# Licensed under the GNU GPL Version 2.
# ***** Configuration *****
# set LOG to the directory you want to write the performance data to.
# set HDD to the number of had disks in your machine.
# NOTE : Do not change the variable LIMIT
filename=$(date +%Y%m%d%H%M%S)
for((num=0;num> ${LOG}/vm.${filename}.log &
sleep $SLEEP
if [[ LIMIT -eq test ]]
#VM csv
echo Date,Time,Procs in Run Queue,Procs Blocked,Virtual Memory Used,Idle Memory,Buff Memory Used,Cache Memory Used,Swap In,Swap Out,Blocks Received,Blocks Sent,System Interrupt,Context Switches/sec,Cpu User Time,Cpu System Time,Cpu Idle Time,Cpu Waiting Time> ${LOG}/vm.${filename}.csv
cat ${LOG}/vm.${filename}.log awk '{for(l=1;l<17;l++)>> ${LOG}/vm.${filename}.csv
case $1 in
genStat $2 $3
echo -e ":::: Usage ::::"
echo -e "$0 run 5 10 : Collect stats for 5 times with 10 seconds interval"
echo -e "Note : Change the first parameter for the number of stats"
echo -e " Change the second parameter for the number of seconds between each stats"


The original script was developed by Mark Boddington and could be obtained from

The modified script allows the interval between each collection and the number of times the collection is made. However, this script lacks the ability to set the output path and it is created based on vmstat. Also, you will have to estimate the completion time for the scenario to complete.

To use the script, copy the quoted content (above) and name it Then in the directory that the script exists, type the following:

\ 5 10

Where 5 is the number of times the collection is made and 10 is the interval between each collection in seconds.

Once the collection is complete, import the file in analysis. Our settings in Analysis are as follows.

This is a minimal start for us and we intend to further enhance the script to allow the following (provided we can squeeze some time out):

1. Changing of the output path

2. Include iostat and netstat.

Please feel free to use the script and we welcome suggestions, modifications and enhancement to the scripts to make it a better tool.

(simple tools making lifes easier)

Related Topics

Tools: Duplicating Files Prior Load Test

Tools: Determine the Windows patches installed using Windows 2003 Resource Kit

Labels: , , , , , ,

Bookmark this article now! AddThis Social Bookmark Button

technorati reddit digg

0 Responses to “Tools: Monitoring Unix Resource Script ver 1.0”

Post a Comment

Powered by Google

Enter your email address:

Delivered by FeedBurner

Add to Technorati Favorites


Powered by Blogger

make money online blogger templates

Powered by FeedBurner

Blog Directory

Top Blogs

Software Blogs -  Blog Catalog Blog Directory

© 2007 Performance Testing, LoadRunner Tips&Tricks | Blogger Templates by GeckoandFly.
No part of the content or the blog may be reproduced without prior written permission.
Learn how to make money online | First Aid and Health Information at Medical Health