I’ve been thinking about creating a Rails app to help me monitor my main Windows 2003 server. Today, one of the logical drives on the server got close to running out of space, so I realised it was time to get that monitoring in place.
One of the things that had delayed starting this project was deciding on a good way to gather the data. The solution was simple – use 2003’s in built performance monitor.
A little play with the performance monitor showed me that it was easy to get the data into a CSV file, but I could not get it to send the data directly to a SQL database. However, a little googling got me to a blog by one Hilary Cotter. That gave me the key step I needed: use relog to transfer the csv file up to the SQL server. I am still not sure why this works but writing directly to SQL does not.
I had a little fiddle with ODBC permissions, but finally got them to work using standard logins as Hilary suggests.
The bit I was worried about was configuring the tables the data would go into. However, I should not have worried as the process generates the tables automatically.
The performance counter properties allows a process to be triggered after the counter stops, so it was just a case of putting the relog command into a batch file and pointing the end process at that.
I’ve currently set the counter to close after running for 20 minutes, and scheduled a task to:
at midday every day. Strangely you cannot use the performance tool’s own scheduling to configure regular event runs, and that is why I’d had to schedule a logman command to start the process at a given time each day.
In a few days I should be able to assess if that’s giving me enough of a snapshot of data. With the data being regularly added to the database, it should be a fairly simple task to built a Rails app to display the data.
——–
An update: as of October 2009 this project hasn’t moved on. I may get back to it, but at the moment it looks like it will be one of those good ideas that doesn’t get acted upon. I have used the monitor data and having that has proved useful. Just at the moment purely as a manual tool with no automated monitoring.