How to write a wrapper script for iostat
I need to write a wrapper script for iostat functionality . in solaris unix i have iostat but in linux i dont have iostat , so I need to write a wrapper script which does all the functionality of iostat . can anyone help me? i am entirely new to scripting
|
Quote:
Second, if you need help writing a script, there are thousands of scripting tutorials you can find easily with Google. They can help you get started, and please come back and post any specific problems/questions you have (along with your script), and we can try to help. |
Thanks for your reply.
I need to writer a wrapper script for iostat -c and iostat -E . not sure how to start with. if you can kindly help me then I would be very thankful to you... Regards, Sree |
Quote:
If you don't know how to write a script, then as I suggested before, go to Google, type in "linux bash scripting tutorials", and press ENTER. Pick one of the thousands of hits, and go from there. Again, we are NOT going to write your script for you, but will HELP you if you get stuck...you will need to post what you've written, and what problems you have. |
You don't really want a wrapper.
In Linux you want to install the sysstat package. That contains iostat, vmstat, mpstat, and sar. |
thanks...
iostat is in my linux... but my requirement is to write a script which helps me to call iostat indirectly like .. instead of calling iostat -c it will be myiostat -c . can you help me to write a script which does this |
iostat is in my linux...
but my requirement is to write a script which helps me to call iostat indirectly like .. instead of calling iostat -c it will be myiostat -c . can you help me to write a script which does this |
Quote:
Code:
#!/bin/bash |
Hi,
Welcome to LQ! So you've shown us your need! What's your deed? We will aid you when you help yourself to a solution. Provide us with what you have attempted and then maybe someone will be able to assist. Linux Shell Scripting Tutorial v1.05r3 A Beginner's handbook tutorial is designed for beginners who wish to learn the basics of shell scripting/programming plus introduction to power tools such as awk, sed, etc. Start out at items 4, 5 and 6 below. Just a few links to aid you to gaining some understanding; 1 Linux Documentation Project 2 Rute Tutorial & Exposition 3 Linux Command Guide 4 Bash Beginners Guide 5 Bash Reference Manual 6 Advanced Bash-Scripting Guide 7 Linux Newbie Admin Guide 8 LinuxSelfHelp 9 Getting Started with Linux The above links and others can be found at 'Slackware-Links'. More than just Slackware® links! |
as you said i need a script like .
#! /bin/ksh function myiostat { # Built in commands used in this function CMD_USR_PATH="/usr/bin" CMD_PATH="/bin" ......... [[ $1 = "-E" ]] then ....... return } does anyone knows to write this type of script. ? |
Quote:
|
Some scripting tutorials
http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ There's more than enough info there to make you an expert, if you only apply yourself. |
equivalent of iostat -E
Hi,
Thanks..... what is the equivalent of iostat –E in linux ( it display all device error statics). Linux which am using dosent support iostat -E |
The example script where shown is about functions in scripting. Here is one small example. Its very very simple and easy.
_____________________ #!/bin/bash cat() { echo "I'm into cat" } cow() { echo "I'm into function cow" } cat cow exit 0 -------------------- reg Happy Programming |
Quote:
Check the man pages for iostat and other utilities in the "sysstat" package. |
All times are GMT -5. The time now is 04:39 PM. |