Writing VMStat data to a file

I am trying to create several performance planning reports, and one of these details is to have memory usage information for several Unix servers.

Now my knowledge of Unix is ​​very low. Usually I just log in and run some scripts.

But for this report, I need to collect VMStat data and prepare reports based on previous data of the past week, disaggregated by hours, which is the average value of Vmstat data, which is taken every 10 seconds.

So, the first question: is VMStat registered by default, and if so, what location on the server is the data output?

If not, how can I fix this?

thank

+5
source share
1 answer

vmstat - , .

, ( ), 60 479 10

, :

nohup vmstat 10 604879 > myvmstatfile.dat &

myvmstatfile.dat

EDIT: RobKielty (& , nohup . , , . df -h /path/to/directory/where/outputfile/resides .)

, , .

crontab entry (crontab -e)

0 0 * * 0  /path/to/my/vmstat_script.sh 

vmstat_script.sh bash script.

#!/bin/bash
# vmstat_script.sh
vmstat 10 604879 > myvmstatfile.dat
mv myvmstatfile.dat myvmstatfile.dat.`date +%Y-%m-%d`

myvmstatfile.dat.2012-07-01

+9

All Articles