Operating System - HP-UX
1753787 Members
7470 Online
108799 Solutions
New Discussion юеВ

VMSTAT OUTPUT WITH DATE & TIME

 
SOLVED
Go to solution
oprakash
Frequent Advisor

VMSTAT OUTPUT WITH DATE & TIME

Hi,

I want to take vmstat output with date & time, every 30 min time interval for 24 hous if its possible can any one suggest.
5 REPLIES 5
Kranti Mahmud
Honored Contributor

Re: VMSTAT OUTPUT WITH DATE & TIME

Hi Omprakash,

For time

vmstat -t

-t
Prints the time-stamp next to each line of output of vmstat. The
time-stamp is displayed in the HH:MM:SS format. Note: Time stamp
will not be printed if -f, -s, or -i flags are specified.

My example for daily 8 hour with date in filename :
vmstat -t 1 28800 >/home/db2inst1/nncron/vmstats/nnVmstat8h_`date +%Y
%m%d"-"%H%M`.log

Or check the manpage

man vmstat

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Jeeshan
Honored Contributor
Solution

Re: VMSTAT OUTPUT WITH DATE & TIME

there is no such option with vmstat in hp-ux. you can redirect to its output in a file with a counter and interval options.
a warrior never quits
Suraj K Sankari
Honored Contributor

Re: VMSTAT OUTPUT WITH DATE & TIME

HI,
Make a script and put this into cron job and set to run every 30 min of intervel.

suraj
oprakash
Frequent Advisor

Re: VMSTAT OUTPUT WITH DATE & TIME

Thanks, i have created a script for this and scheduled in cron
Steven E. Protter
Exalted Contributor

Re: VMSTAT OUTPUT WITH DATE & TIME

Shalom,

If the man page for vmstat can not do this for you then try a script like this:


while true
do
vmstat >> ouptut
date >> output
done
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com