Monday 24 October 2011

netapp perfstat

I needed to run some perfstats today to capture some benchmarking, unfortunatley the netapp provided example didnt work for me which is listed as:

perfstat -f filer1 -t 30 -i 46 > perfstat-"Date_%date:~4,2%%date:~7,2%%date:~10,4%-Time_%time:~0,2%h%time:~3,2%m%time:~6,2%s"

Having had a quick look at this, there are a number of reasons, I am on windows 2008 r2 and its trying to RSH - dont bother in 2008.. you need to use plink as stated in the documentation. so i changed the cmd line to use plink as follows, substitute username and password...

perfstat -S pw:netapp -l root -f filer1 -t 30 -i 46 > perfstat-"Date_%date:~4,2%%date:~7,2%%date:~10,4%-Time_%time:~0,2%h%time:~3,2%m%time:~6,2%s"

This still didnt work as the SSH host key hadnt been saved on the system I was using, quick work around, fire up putty, Login whilst saving the key.

Running this: perfstat -S pw:netapp -l root -f filer1 -t 30 -i 46 now works.

The next problem I have is the date format my system is using or something I couldnt be bothered to investigate.. so if you do

echo Date_%date:~4,2%%date:~7,2%%date:~10,4%-Time_%time:~0,2%h%time:~3,2%m%time:~6,2%s

You get a garbled date string back with a slash in it this is because the example expects echo %date% to return the day of the week ie, Mon 24/10/2011

Where as mine displays a short date ie 24/10/2011, This is a simple fix, but for reference in DOS part of a string can be retuned (MID) by the following VariableName Start,Legth Which in this case %date:~4,2% should return 24 as %date% SHOULD = Mon 24/10/2011 but it doesn't.

Anyway here's the modified version for todays use - however I shoved it into a batch file to run both filers

@echo off
start perfstat -S pw:netapp -l root -f filer1 -t 30 -i 46 > c:\perfstat\Filer1_perfstat-Date_%date:~0,2%_%date:~3,2%_%date:~6,4%-Time_%time:~0,2%h%time:~3,2%m%time:~6,2%s
start perfstat -S pw:netapp -l root -f filer2 -t 30 -i 46 > c:\perfstat\Filer2_perfstat-Date_%date:~0,2%_%date:~3,2%_%date:~6,4%-Time_%time:~0,2%h%time:~3,2%m%time:~6,2%s

No comments:

Post a Comment