I know Activity Monitor exists to view disk i/o and other performance metrics. However, does Activity Monitor have the ability to log any of these metrics?

If not, how can I log these metrics into a database or csv file and how often should these be logged? Every second?

I'm looking to run reports to see at what times of the day the server has a lot of disk i/o for capacity management. Also want the ability to log used and free space every 15 minutes.


You can use traditional unix tools to start monitoring now.

iostat 60 | tee /tmp/iostat_60.log

The free space statistics can be generated with the df command, but you might just set your warning levels on server app and rely on alerts to notify you when space fills. I can't imagine needing to track storage space more than once a day to graph the growth or manage things, but your needs might be quite different.

I'd say 15 minute (900 seconds for iostat) snaps of io activity would be sufficient and hourly or daily disk space logs would be overkill for most servers. You would probably decrease the monitoring interval during an investigation / performance tuning period, but day in and day out these stats usually just chew up CPU and disk space and don't really help you manage the server.

Once you decide upon how often you want to capture the data, you can get more fancy with a wrapper to start and stop the script / cut and process the log files daily, etc...

I would say you're going to want to instead look at the tools you want for actually analyzing and acting on the data. For one server, you could probably get away with one free instance of splunk running and just log the data to syslog.

From there you can graph / extract to spreadsheet / act on the data in a very flexible manner. Also, you might look at elasticsearch, logstash and kibana.

There is an excellent write up at http://krypted.com/windows-server/stashbox-turning-a-mac-mini-into-a-logstash-server/ by Charles Edge explaining the how and why you would use those tools to tame the logs and graph things. If you had that, sending the statistics to the system log might be a very easy way to solve your problem of monitoring IO on your server.

  • I agree that 15 minute snaps of disk usage is overkill in my situation. I can probably get away with daily. When I run the df command, it populates all the partitions. Is it possible to just capture the /dev/sda1? I also would like the output to be in a csv file as NAME_OF_DISK,Used,Available,Use% and not include anything else. – macuser76 Apr 25 '14 at 17:02
  • You can do just about anything with grep, awk, and sed and python has really nice csv input and output. It depends if you like to script. df | grep disk0s2 | awk '{ print $2 "," $3 "," $4}' – bmike Apr 25 '14 at 17:08
  • Awesome! Now how can I just capture the total disk i/o and not per running application/process in the same csv format? – macuser76 Apr 25 '14 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .