Condividi tramite


PAL collector script – PalCollector.ps1

One of the top questions I get with the PAL tool is what data to collect. As many of you know, the PAL tool only analyze existing counter logs. It is up to you to create the counter log. To help with this problem, I created a PowerShell script called PalCollector.ps1. This script will query your local computer’s performance counters and will find a PAL threshold file that best matches your computer, then it creates a data collector set called, “PalCollector” using the counter paths from the best matching threshold file. It creates the data collector as a 200 MB binary circular log which means that it will continuously collect data every 15 seconds and will never get over 200 MB in size – roughly 24 hours of data. Once you are done collecting data, analyze the counter log (*.blg) using the PAL tool as you normally would.

Instructions

  1. Download PalCollector.zip from https://sdrv.ms/10dZBNb.
  2. Extract the zip file to a folder such as your Desktop or somewhere under your “My Documents” folder.
  3. In Windows Explorer, find PalCollector.ps1, go to Properties of the file and click the Unblock button. This will allow the script to run on your system.
  4. With administrator rights (required) open an elevated PowerShell session.
  5. If your execution policy is not set to RemoteSigned or Unrestricted, then do so now by running:
    Get-ExecutionPolicy
    Set-ExecutionPolicy RemoteSigned
  6. Change directory to the location where you extracted the zip file.
  7. Run “.\PalCollector.ps1”

Please let me know your thoughts on how it is working for you and any recommendations on improvement.

Comments

  • Anonymous
    January 01, 2003
    Sorry for my delay in responses. I've been heads down working on my book.
    I just uploaded the PalCollector.ps1 scripts to the PAL tool web site at http://pal.codeplex.com. I'll ship the script with the PAL tool as well starting with PAL 2.5.

  • Anonymous
    January 01, 2003
    Oops. I also had to change:

    <br>$aCounters.CounterPath | Out-File -FilePath &quot;$UserTempDirectorycounterlist.txt&quot;<br>

    to:

    <br>$aCounters | select CounterPath | Out-File -FilePath &quot;$UserTempDirectorycounterlist.txt&quot;<br>

  • Anonymous
    January 01, 2003
    I couldn't upgrade to PS3 so I changed this:

    <br>#// DATASOURCE<br>ForEach ($XmlCounter in $XmlPalAnalysisInstance.SelectNodes('./DATASOURCE'))<br>{<br>$sCounterDataSourceCategory = GetCounterObject $XmlCounter.NAME<br><br>ForEach ($sCounterObjectOnComputer in $oCounterObjects.CounterSetName)<br>{<br>If ($sCounterDataSourceCategory -eq $sCounterObjectOnComputer)<br>{<br>#//Write-host $sCounterDataSourceCategory<br>If ($global:alCounterList.Contains($XmlCounter.NAME) -eq $False)<br>

    to:

    <br>#// DATASOURCE<br>ForEach ($XmlCounter in $XmlPalAnalysisInstance.SelectNodes('./DATASOURCE'))<br>{<br>$sCounterDataSourceCategory = GetCounterObject $XmlCounter.NAME<br><br>ForEach ($sCounterObjectOnComputer in $oCounterObjects)<br>{<br>If ($sCounterDataSourceCategory -eq $sCounterObjectOnComputer.CounterSetName)<br>{<br>#//Write-host $sCounterDataSourceCategory<br>If ($global:alCounterList.Contains($XmlCounter.NAME) -eq $False)<br>

    I also changed:

    <br>If ($bMatch = $True)<br>

    to:

    <br>If ($bMatch -eq $True)<br>

    Works now.

  • Anonymous
    January 21, 2013
    The download link doesn't work. Is there any other location where we can download this file? Thanks, Nesh

  • Anonymous
    February 15, 2013
    Is the download link going to get corrected? Thanks, Jesse

  • Anonymous
    March 18, 2013
    Thanks Clint!

  • Anonymous
    June 11, 2013
    The download link works for me. Please let me know if you still can't get to it. Please keep in mind that it is on my personal SkyDrive and many corporations block access to SkyDrive.

  • Anonymous
    December 17, 2013
    The comment has been removed

  • Anonymous
    April 28, 2014
    Hi Clint,

    Awesome stuff as always. Is there any way to pass it a specific threshold choice and override the threshold selection logic of the script? If not, could you conisder adding that?

  • Anonymous
    June 17, 2014
    The comment has been removed

  • Anonymous
    June 17, 2014
    The comment has been removed

  • Anonymous
    June 19, 2014
    The comment has been removed

  • Anonymous
    March 03, 2015
    could you please update the download link? It seems broken and I'd like to try this script... :)
    Thanks for all your work!

  • Anonymous
    March 03, 2015
    Oh - silly me, I didn't see your comment above, that the script is included in the PAL download. I found it, thank you!