Computing.Net > Forums > Unix > unix scripting help needed.

unix scripting help needed.

Reply to Message Icon

Original Message
Name: Tho
Date: September 28, 2001 at 06:59:16 Pacific
Subject: unix scripting help needed.
Comment:

Hi guys, I'm a newbie to the UNIX OS, I need to know if I can write scripts to automate commands and if I can, how would I do it...

I need to take CPU and memory utilization readings (as well as other commands, such as iostat, mpstat, vmstat, etc) of the UNIX box every 10 seconds or so... dump those readings into a text file for graphing, etc.

Does anyone know if there is a utility that already does this? If not, does anyone have any sample scripts that I can view?

Thanks


Report Offensive Message For Removal


Response Number 1
Name: tom z.
Date: September 28, 2001 at 19:17:30 Pacific
Reply: (edit)

Hmm, some UNIX's have a routine called:

perfmeter

Try looking for that.

One word of warning, just using this or any other utility will squeue your results, at least a little.

Hope this helps, good luck.


Report Offensive Follow Up For Removal

Response Number 2
Name: MoHicAn
Date: October 7, 2001 at 16:11:03 Pacific
Reply: (edit)

Make a script like this

# !/bin/sh

iostat >> /path/to/log &
mpstat >> /path/to/log &
vmstat >> /path/to/log &


and then add a line in
/etc/crontab
saying something like this ..

1 * * * * root /path/to/script

this means cron will start the script every minute ... i think you can't specify seconds
to cron ....

Of course for you to be able to do this
cron daemon has to be started ....
But most unix-es start it by default during boot ...


Report Offensive Follow Up For Removal

Response Number 3
Name: Gin
Date: November 12, 2001 at 14:40:51 Pacific
Reply: (edit)

Hi Everyone,

I need help with Unix. I have to write a script that will convert currency. It has
to convert US to Canadian dollars and vice versa. And it should be able to convert anyother currency.

Thanks

Gina


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: unix scripting help needed.

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge