for problem in iostat script on solaris


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting for problem in iostat script on solaris
# 1  
Old 05-06-2009
for loop syntax problem in iostat script on solaris

bash-3.00# ./test.sh 100 10
./test.sh: syntax error at line 6: `(' unexpected
bash-3.00# cat test.sh
#!/bin/sh
start=0
end=$1
interval=$2
iostat -xnpr > disk_iostats.csv
for (( start=0; $start<=$end; start=$(($start+$interval)) ))
do
sleep $interval
iostat -xnpr | grep -v device >> disk_iostats.csv
done
bash-3.00#


Hello Experts, i'm stuck with some silly problme here with for, not sure where i'm doing wrong. can somebody point me my mistake in the above script?
:: two arguments i'm taking are end (which tels how many secs to run) and interval (which tells the interval of every run of iostat)


the above script runs fine on linux but not on solaris!?

Thanks for your time.

Last edited by ilan; 05-06-2009 at 12:31 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Stop/start script problem on Solaris-10

I have Big brother script, which start/stop Big Brother processes. Something got change on server and now I am not able to start/stop it. There is no change in script, as I compared it from other server. This service is being managed by bb user (group is also bb). root@tsazdq04:/#... (6 Replies)
Discussion started by: solaris_1977
6 Replies

2. Solaris

Problem in getting total Disk space using iostat -En command

Hi Everyone, I try to calculate the total hard disk space of a solaris machine using iostat -En command. Iterating the output and summing up all the number present near the Size: will give the exact size of the harddisk. But it is not working for a machine. This command works in many flavors... (2 Replies)
Discussion started by: prasankn
2 Replies

3. AIX

Help with iostat

Hello, I support Oracle 11g on AIX 7.1. Using the command $iostat -D hdisk2 hdisk4 hdisk5 5 I get the following output: hdisk5 xfer: %tm_act bps tps bread bwrtn 44.0 1.4M 178.2 1.4M 14.7K read: ... (3 Replies)
Discussion started by: oracledba1024
3 Replies

4. UNIX for Advanced & Expert Users

Shell script to monitor cpu and VMstat, iostat

Hi , I am new to scripting. please help me out how to write a script to monitor cpu , vmstat, iostat in Redhat linux. we are doing the load test. Thanks in advance !!!! (1 Reply)
Discussion started by: saanvi
1 Replies

5. Shell Programming and Scripting

IOSTAT monitoring

Does anyone have an example of IOSTAT -eE in a script??????? Need to see the syntax in a script (4 Replies)
Discussion started by: walnutpony123
4 Replies

6. Shell Programming and Scripting

Problem with a script on a solaris 10 box

Hi Gurus I have several SAN's in two different locations. I collect performance data and archive them. In one location the archiving script runs on a solaris 9 server and in the other on a solaris 10 server. But the script fails every day on the solaris 10 server with this mes6=`/usr/bin/du -sk... (5 Replies)
Discussion started by: gnom
5 Replies

7. Red Hat

iostat on Redhat 5

A find for the "iostat" command on a redhat 5 update 4 comes back with no results. Any separate rpm needs to be installed to get the binary for this ? Thanks in advance. (1 Reply)
Discussion started by: uxadmin007
1 Replies

8. Shell Programming and Scripting

iostat on solaris

Friends. I have to compare iostat -x output with a tool on solaris. Now there is column called wait in the output field which is showing zero. Now, in order to create some load on my system this is what i am doing I am creating a file using dd command , the size of which is... (5 Replies)
Discussion started by: achak01
5 Replies

9. AIX

how to identified this iostat value

Hi All AIX expert i'm using AIX 5.2 When i execute this command which is : ---------------------------------------------------------------------- >> iostat -a System configuration: lcpu=4 disk=30 tty: tin tout avg-cpu: % user % sys % idle % iowait ... (2 Replies)
Discussion started by: adzuanamir
2 Replies

10. Filesystems, Disks and Memory

Help with iostat ...

All, I am attempting to help tune a Sun for better performance (mainly for SAS 9.1), and have found indicators pointing to poor I/O utilization. I have run iostat -cx, and found one device in particular where the %w is in the 90's during processing. I have a feeling that this is where the SAS... (3 Replies)
Discussion started by: dj_is
3 Replies
Login or Register to Ask a Question
iostat(1)						      General Commands Manual							 iostat(1)

Name
       iostat - report I/O statistics

Syntax
       iostat [ -c ] [ -t ] [ disknames ] [ interval ] [ count ]

Description
       The  command  reports  I/O  statistics for terminals, disks and cpus.  For terminals the number of input and output characters are counted.
       For disks the number of 512 byte blocks per second and number of transfers per second are displayed.  For cpus, it provides the	percentage
       of  time  the system has spent in user mode, in user mode running low priority (niced) processes, in system mode, and idling.  On multipro-
       cessor systems these cpu statistics represent a cumulative summary of all the cpus.

       The optional disknames argument causes disk statistics to be displayed for the specified disks.	If this argument  is  not  specified  then
       disk statistics will be displayed for the first 3 disks only.

       The  optional interval argument causes to report once each interval seconds.  The first report is for all time since a reboot and each sub-
       sequent report is for the last interval only.

       The optional count argument restricts the number of reports.

Options
       -c   Displays the percentage of time each cpu spent in user mode, running low priority (nice'd) processes, in system mode, and idling.

       -t   Displays the number of characters read from and written to terminals.

Examples
       This example will cause cpu and disk statistics for the 5 disks ra0, ra1, ra2, ra3, and ra4.
	    iostat ra0 ra1 ra2 ra3 ra4
       This example will cause cpu, terminal, and disk statistics for ra0 to be displayed and updated every 2 seconds.
	    iostat -t ra0 2

Files
See Also
       vmstat(1), cpustat(1)

																	 iostat(1)