-
-
If you need to gather performance data from multiple systems, it can be hard manual labor (and just plain boring) setting up all those collector sets manually. This PowerShell scripts servers as a wrapper for logman.exe which can create data collector sets from a command line.
It takes input in the form of which servers (servers.txt) you want to monitor, and which performance counters (counters.txt) you want to monitor. Both .txt files should be placed in the same directory as the .ps1.
The default for the script is to create collectors that run for 1 week, and polls every 2 minutes. This can all be changed though, just type logman /? In a prompt to list all the features available.
I have attached a .zip file containing both the PowerShell script and a counters.txt which contain some basic/standard counters for general performance monitoring.
If you would like to monitor specific counters feel free to create your own counters.txt file. (Note that <HOSTNAME> must still go in front of each line as in the included counters.txt) The easiest way to list performance counters is to use typeperf.exe. This tool lists all the performance counters on the system where it is executed. To list all counters included in the Processor object simply type:
typeperf.exe -q Processor
The easiest way to add counters is to use asterisk (*) to define instances. This way you won’t run into issues with defining which devices you want to see statistics for. For example the instance \LogicalDisk(*)\Disk Reads/sec would give you Disk Reads/sec for all logical disks defined on the target system, no matter how many drives are defined.
Be aware that when choosing counters for use with multiple servers, they must be available on all systems.
I hope you find it usefull – this can be a great way to quickly set up a baseline for multiple systems, or to simply monitor your systems on a regular basis.