Finalized some changes in the modules before and show them I want again to thank Sir Allen White (Twitter | Blog) , who was the post that inspired me to build this module. Essential reading –> Performance data Gathering
If you want, the others pots about are :
Some changes are made as work with multiple servers and save into SQL Server Table, and all tests were done in 2 Hype-V 64 bits Virtual Machines. One Is a Windows 2008 Server R2 domain controller with SQL Server 2008 R2 (Obiwan) and the other Workstation Windows 7 with SQL Server 2008 (Chewie) :
Work with Multiple Servers
first have to enable Remote Registry service on remote machines if it is disabled.
If you want to read more about , I suggest –> Why run the RemoteRegistry Service?
Now, You can Pipe the servers to Get-PerfCounterCategory function :
Get all counters starting with page life* in Buffer Manager category in servers ObiWan and Chewie
You can also create a Txt file with the servers and use :
Let’s create a complete example First choose the counters that we use. In case all the SQL Server Buffer Manager category in Chewie and ObiWan machines and save into c:\temp\BufferManager.XML
And ONE FILE for each server will be created, using the name passing in –PathConfigFile parameter adding the server name :
Now, with the XML configured we can start the gathering using backgrounds Jobs and saving into a SQL Server Table. We do not pass the table name as parameter so one table for each server will be created using the name PERFCOUNTERS_XMLNAME_YYYYmmDDhhMMss. You always have to pass the path to output file, even using SQL Table, because the output file alwasys will be created. Why ?. Lets say you lost you connection to the SQL Server respository. you do not lost the data, because they will be in txt file too.
And two jobs are created. Note the name of jobs starting using PERFCOUNTER, so you can use where-object to find all jobs used by Perfcounters Module :
Now if we see in ObiWan SQL Server, there are two tables : one for each server
and the data is gatheing in each server and save in respective table in background
And the TXT files with output gathreing are created too :
You can use your table name too : I am passing the parameter –TableName with “BufferManager”..and for each server will be created one table called BufferManager_SERVER..in this case BufferManager_Chewie and BufferManager_ObiWan.
Why I can do this ?. Lets say if yu stop the gathering and want to continue in another day, but in the same table. Just Pass the TableName parameter with the name of the table and not pass the switch parameter –newtable :
Remember, in this case you have to explicity the XML file. Ih this case I will start again the gathering to Chewie, with xml file c:\temp\BufferManager_Chewie.xml and save to BufferManager_Chewie table.
The data is saved without creating new table and the output txt file is always created, as a data backup.
In this examples I use Windows Authentication, but you can pass the username and password as parameters.
For more information type get-help <function> -examples.
I hope you like :)..Any questions or comments are welcome.
A big hug to everyone
POWERSHELL ROCKS !!!
“Oh, come on, come on, come on, come on!
Didn’t I make you feel like you were the only man —yeah!
Didn’t I give you nearly everything that a woman possibly can ?
Honey, you know I did!
And each time I tell myself that I, well I think I’ve had enough,
But I’m gonna show you, baby, that a woman can be tough.
I want you to come on, come on, come on, come on and take it,
Take another little piece of my heart now, baby!
Oh, oh, break it!
Break another little bit of my heart now, darling, yeah, yeah,yeah.
Oh, oh, have a!
Have another little piece of my heart now, baby,
You know you got it if it makes you feel good,
Oh, yes indeed”