In this post, I would like to briefly demonstrate how a PowerShell script collection rule can be configured with MP Author SP1, and emphasize on the changes to this feature from the older RTM version.
For more in depth information on how to create a PowerShell script collection rule using the older version of MP Author, please visit my previous blog post. The steps to create a PowerShell script collection rule are mostly identical between the 2 versions.


image



To create a PowerShell script collection rule with MP Author SP1:

  1. Select the Create New Script Performance Rule option to launch the wizard, then specify the Script name, Script body, and Script Parameters on the Specify Script Information page, before mapping the data from the ProprtyBag to the performance data.

    image

    image


    Note:
    The sample script used for this demo is a script that collects Health Service Workflow Count value from the performance monitor of an agent managed computer and returns this information in a ProprtyBag.

  2. Configure the target and identity for the monitor and enable the monitor.

    image

    image



  3. IMPORTANT CHANGE: A new page for Rule Options has been added.

    On the Rule Options page, there is a new option to create a new view for the performance collection, and options to Save to Data Warehouse and Create a Linked Report.       
            
    image

    Reminder:
    Specify a folder to place the View to be created otherwise the view gets lost in limbo.


    image

    Reminder:
    Specify Microsoft.SystemCenter.Monitoring.ViewFolder.Root folder to place the view on the root of the Monitoring Workspace.

    Note that unlike the Authoring Console, it doesn't allow one to drill down to the custom management pack folder to place the custom view. Hence the only place to park a new custom view is at the root folder in the Monitoring workspace.

    image


    *************************************** FINDINGS ****************************************

    Even if the steps above were followed, the custom view will not show up in the root folder of the Monitoring workspace because the Visible tag was set to “false” by default. (invisible ???)

    image


    And Even If the visibility is fixed by replacing the “false” value with “true”, the custom view will show up at the root of the Monitoring workspace without a display name as follows:

    image


    This is because the association between the View ID and a display name was NOT made in the DisplayString section when the MP was created.

    image

    The workaround for this is to open up the property page of the custom view and key in a name for it:

    image


    And Even if the display name part of the custom view is addressed, it will still show up as an empty view because the conditions are not met for the view’s search criteria, i.e. it pops the data property bag variable used in the collection rule definition into the instance name condition as follows:

    image


    The workaround for this is just to uncheck the condition for “a specific instance name” and allow the remaining conditions to locate the collection rule.

    image



    The custom view should look like this after applying the workaround:

    image




    Linked Report:

    The custom link report should appear in the Reporting workspace:

    image

    However, the following error message was encountered ( “The ‘TimeType parameter is missing a value” ) when the report was ran.

    image


             
    ************************* END OF FINDINGS **************************************

  4. IMPORTANT CHANGE: Option to set the schedule to run at a periodic interval (like every x minutes) has been added to the UI.

    image



  5. Review the configuration summary before creating the PowerShell script collection rule. Import the MP Author SP1 created management pack into an OpsMgr management group to test the PowerShell script collection rule and view created. 

   

What hasn't changed:

Still not able to launch a wizard to edit the PowerShell script collection rule setting after the rule is created.
Clicking the Edit XML button will display the following XML definition for the rule at the collection rule level, hence not able to find and edit the PowerShell script for the rule in the XML definition.

image



To see how to modify the script embedded in the management pack of the collection rule, please refer to my previous blog post.


Hope this article gives you a better idea on how to configure and make this MP Author SP1 feature work for your specific performance collection and reporting scenarios.


image



Disclaimer:
All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.