Adding and editing a PowerShell Scripting performance monitor

Windows PowerShell is a scripting language and command-line shell that system administrators can use to manage Windows operating systems. For more information on PowerShell, please visit the Microsoft web site.

The PowerShell Scripting performance monitor allows the experienced user to perform a wide variety of monitoring tasks through direct access to script component libraries, including the .NET Framework. The Windows PowerShell scripting language can be used in conjunction with WhatsUp Gold to help you monitor, control, manage, and automate Windows operating system activities. For example, you might implement a script to look for a process and report the current number of threads in the process. Or, you might implement a script to look for idle time levels and log the results. For more information and examples of PowerShell performance monitors, see PowerShell performance monitor script examples.

Important: WhatsUp Gold uses a 32-bit (i.e. x86) PowerShell engine. Therefore, only 32-bit PowerShell snap-ins are supported and 64-bit only snap-ins will not function properly. Snap-ins usable in both 32-bit and 64-bit operating systems are configured for 64-bit systems by default and must be manually configured for 32-bit PowerShell engine to function properly with WhatsUp Gold.

If you are using additional pollers with WhatsUp Gold, PowerShell must be installed and any desired snap-ins must be registered identically on all poller machines for any PowerShell performance monitors, active monitors, and actions to function properly. Associated errors resulting from failed monitors will appear in the WhatsUp Gold Status Center. Errors resulting from failed actions will appear in the WhatsUp Gold Event Viewer.

Note: This feature is available with WhatsUp Gold Premium Edition only. To update your license, visit the WhatsUp Customer Portal.

To add a new PowerShell performance monitor:

  1. From the WhatsUp Gold web interface, go to Admin > Monitors. The Monitor Library dialog appears.
  2. Click the Performance tab. The Performance Monitor list appears.
  3. Click New. The Select Performance Monitor Type dialog appears.
  4. Select PowerShell Scripting Monitor, then click OK. The Add PowerShell Performance Monitor dialog appears.
  5. Enter or select the appropriate information:
    • Name. Enter a unique name for the performance monitor. This name displays in the Performance Monitor Library.
    • Description. (Optional) Enter additional information about the monitor. This description displays next to the monitor in the Performance Monitor Library.
    • Timeout (sec). Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the SMTP server. This is considered a failed connection.

    Note: Although the default timeout is 60 seconds, you are highly discouraged from using a timeout longer than 10 seconds. Please use the shortest timeout possible.

    Note: The use of reference variables in the PowerShell performance monitor is optional. If you do use them, you must use Context.GetReferenceVariable,for reference variables to be polled and their data graphed. Reference variables simplify your scripting code and enable you to write scripts efficiently, without having to use a list of device properties, as with the Script Action and Script Active Monitor. They manage the underlying SNMP or WMI mechanisms you would normally have to manage in order to access SNMP or WMI counters on a remote device.

    By using the Context.GetReferenceVariable (variable name), you only need to specify the name of a pre-defined variable. WhatsUp Gold uses device credentials and connects to the target device using SNMP or WMI to retrieve the requested information. This information is stored in a variable that you can use later in your script. For more information, see Using the context object with performance monitors.

    • Run under device credentials. Select this check box to execute the script using the Windows credentials for the affected device. For additional information, see Using the Credentials Library.
    • Script text. Enter your code here.
  6. Click OK to save changes.
  7. Click OK to exit the Performance Monitor Library.
  8. After the monitor has been added to the library, you can enable the monitor through Device Properties > Performance Monitors. For more information, see Enabling performance monitors.

To edit an existing PowerShell performance monitor:

  1. From the WhatsUp Gold web interface, go to Admin > Monitors. The Monitor Library dialog appears.
  2. Click the Performance tab. The Performance Monitor list appears.
  3. Select the performance monitor you would like to edit from the list of current monitors, then click Edit.
  4. Enter or select the appropriate information:
    • Name. Enter a unique name for the performance monitor. This name displays in the Performance Monitor Library.
    • Description. (Optional) Enter additional information about the monitor. This description displays next to the monitor in the Performance Monitor Library.
    • Timeout (seconds). Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the SMTP server. This is considered a failed connection.

    Note: Although the default timeout is 60 seconds, you are highly discouraged from using a timeout longer than 10 seconds. Please use the shortest timeout possible.

    Note: The use of reference variables in the PowerShell performance monitor is optional. If you do use them, you must use Context.GetReferenceVariable,for reference variables to be polled and their data graphed. Reference variables simplify your scripting code and enable you to write scripts efficiently, without having to grab a list of device properties, as with the Script Action and Script Active Monitor. They manage the underlying SNMP or WMI mechanisms you would normally have manage to access SNMP or WMI counters on a remote device.

    By using the Context.GetReferenceVariable (variable name), you only need to specify the name of a pre-defined variable. WhatsUp Gold uses device credentials and connects to the target device using SNMP or WMI to retrieve the requested information. This information is stored in a variable that you can use later in your script. For more information, see Using the context object with performance monitors.

    • Run under device credentials. Select this check box to execute the script using the Windows credentials for the affected device. For additional information, see Using the Credentials Library.
    • Script text. Enter your code here.
  5. Click OK to save changes.
  6. Click OK to exit the Performance Monitor Library.

See Also

Using Performance Monitors

Performance monitors overview

Using the Performance Monitor Library

Working with Performance Monitors

Adding and editing an Active Script Performance Monitor

Adding and editing an APC UPS Performance Monitor

Example - PowerShell performance monitor scripts

Adding and editing a Printer performance monitor

Adding and editing an SNMP Performance Monitor

Adding and editing a SQL Query performance monitor

SQL Query Builder

Adding and editing an SSH performance monitor

Adding and editing a Windows Performance Counter Monitor

Adding and editing a WMI Formatted Performance Monitor

Adding and editing a WMI Performance Monitor