Hello everyone,
I'm working on a new test to get In/Out statistics, that test uses iostat command for aix 5. My problem from the fact that i cannot get a part of my result. I tryed many different ways to respect the 3 part result output but i can't go further. Could you please have look on the following code. (I'm using the lastest version of RMA and HM)
#!/bin/sh
OS=`uname`
case "$OS" in
#Linux)
# nbRead=`iostat | awk ' NR == 3 {print $6}'`
# nbWrite=`vmstat | awk ' NR == 3 {print $7}'`
# exit;;
AIX)
nbRead=`iostat | awk ' NR == 5 {print $1}'`
nbWrite=`iostat | awk ' NR == 5 {print $2}'`
iostat | awk ' NR >= 8 && $1 !~ /^cd.*$/ {printf " <"$1": "$5" kb_read and "$6" kb_written>"}' 1> res
echo "ScriptRes:Ok:Disks stats retrieved -> NbReadOp=$nbRead and NbWrittenOp=$nbWrite `cat res`"
rm res
exit;;
*)
echo "ScriptRes:Unknown:script is not designed for $OS"
exit;;
esac
By the way, if you know some commands to get the same statistics for a Linux OS please, let me know...
Regards
Vincent
In Out stats test
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Re: In Out stats test
Well, script is pretty interesting. You know, we do not have AIX in our test environment, so we cannot help much at this point.Vini wrote:I'm working on a new test to get In/Out statistics, that test uses iostat command for aix 5. My problem from the fact that i cannot get a part of my result. I tryed many different ways to respect the 3 part result output but i can't go further. Could you please have look on the following code. (I'm using the lastest version of RMA and HM)
IMHO, the problem might be caused by output redirection to "res" (...1> res ...). I would suggest you to rewrite the script without using additional files.
You may find several useful scripts available in "Script Manager" window. You may use these scripts as an example. http://www.ks-soft.net/hostmon.eng/mfra ... m#shellmng
As I know, iostat utility is supplied with most modern Linux distros. If iostat utility is not present on your system, you may install sysstat package, where it is included into.Vini wrote:By the way, if you know some commands to get the same statistics for a Linux OS please, let me know...
Regards,
Max