2

Am getting the real-time memory stats from vmstat command. I did this using following steps:

$ nohup vmstat 60 > vmstatrecord.app &

the command executes in background and writes the log to the file vmstatrecord.app. When i see use the command

$ ps -A | grep stat

I could see the vmstat running in the background and i could also access the log using tail command as:

$ tail -f vmstatrecord.app

the file updates every 60sec interval.

Now my question is :process continues to write to the file so what will happen if i leave for days ?

Assumption: If the process writes the file forever am afraid that the file size might grow too large

If my assumption is correct and my steps are inefficient. Is there any alternatives to achieve what am trying to achieve from my above steps ?

Already Asked it Here

subash
  • 21
  • 4

1 Answers1

0

Using vmstat to build this sort of thing is possible, but you will get a lot more results for our effort by configuring something like munin or cacti. All of the stats you are getting from vmstat plus iostat plus more will get turned into pretty graphs. Munin and other similar tools use RRD to avoid having data fill up your drive.

chicks
  • 3,793
  • 10
  • 27
  • 36