Clint Huffman's Windows Troubleshooting in the Field Blog

Clint Huffman is a Microsoft Premier Field Engineer (PFE) who has been with Microsoft for over 10 years. This blog documents the challenges he faces week to week in hopes that these experiences will help others.

PAL collector script – PalCollector.ps1

PAL collector script – PalCollector.ps1

  • Comments 12
  • Likes

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 http://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
  • The download link doesn't work. Is there any other location where we can download this file?

    Thanks,

    Nesh

  • Is the download link going to get corrected?

    Thanks,

    Jesse

  • Thanks Clint!

  • 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.

  • have used the pal tool before and setting up again. found you site and tried this. was excited until this ;). any ideas ? happy to be a guinea pig. thanks Kevin followed the steps and got this message. windows 7 ultimate sp1 e.t.c VMWare.xml Matches: 74 Best threshold match: BizTalkServer2006.xml Number of matches: 170 Error: The data is invalid. Error: Data Collector Set was not found. A Performance Monitor data collector called "PalCollector" has been created. Go to Start, Run, "Perfmon", , then navigate User Defined data collector sets to see the data collector. Done!

  • 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?

  • 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.

  • I get the same error:

    Error: The data is invalid. Error: Data Collector Set was not found. A Performance Monitor data collector called "PalCollector" has been created.

    No collector is created.

  • I get the same error:

    Error: The data is invalid. Error: Data Collector Set was not found. A Performance Monitor data collector called "PalCollector" has been created.

    No collector is created.

  • I too had the "error: the data is invalid" and it was apparently due to Powershell 2.0. I installed PS3.0 and it worked like a charm. (Warning: it needed a reboot!)

  • I couldn't upgrade to PS3 so I changed this:

    ```
    #// DATASOURCE
    ForEach ($XmlCounter in $XmlPalAnalysisInstance.SelectNodes('./DATASOURCE'))
    {
    $sCounterDataSourceCategory = GetCounterObject $XmlCounter.NAME

    ForEach ($sCounterObjectOnComputer in $oCounterObjects.CounterSetName)
    {
    If ($sCounterDataSourceCategory -eq $sCounterObjectOnComputer)
    {
    #//Write-host $sCounterDataSourceCategory
    If ($global:alCounterList.Contains($XmlCounter.NAME) -eq $False)
    ```

    to:

    ```
    #// DATASOURCE
    ForEach ($XmlCounter in $XmlPalAnalysisInstance.SelectNodes('./DATASOURCE'))
    {
    $sCounterDataSourceCategory = GetCounterObject $XmlCounter.NAME

    ForEach ($sCounterObjectOnComputer in $oCounterObjects)
    {
    If ($sCounterDataSourceCategory -eq $sCounterObjectOnComputer.CounterSetName)
    {
    #//Write-host $sCounterDataSourceCategory
    If ($global:alCounterList.Contains($XmlCounter.NAME) -eq $False)
    ```

    I also changed:

    ```
    If ($bMatch = $True)
    ```

    to:

    ```
    If ($bMatch -eq $True)
    ```

    Works now.

  • Oops. I also had to change:

    ```
    $aCounters.CounterPath | Out-File -FilePath "$UserTempDirectory\counterlist.txt"
    ```

    to:

    ```
    $aCounters | select CounterPath | Out-File -FilePath "$UserTempDirectory\counterlist.txt"
    ```

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment