» tagged pages
» logout
User:cweiblen
Return to PerformanceEngineer.com

Adding dates to vmstat logs

Make further edits, (or Cancel)

(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

(or Cancel)

Tags Applied to this Entry

1 person has tagged this page:

One of the problems I have with vmstat is that it doesn’t have the option to output timestamps (the way iostat does).

As a result, if you have vmstat logs and you don’t know exactly when it was run or at what interval it was collecting data, then it makes the data less meaningful or makes it a hassle to track down the information.

It is easy enough to add the date, using a simple shell script. Create a file, add_date.sh, containing the following:
#!/bin/bash

while read data; do
        echo `date '+%m/%d/%Y %H:%M:%S'` $data
done
Username:
Password:
(or Cancel)