Creating device-specific Active Script performance monitors

Warning: Modifying the configuration of any of the VoIP Active Script Performance monitors is not recommended; doing so prevents the VoIP setup utility from detecting pre-existing VoIP configuration.

For more information on the Active Script Performance Monitor, see Scripting Performance Monitors.

This script performance monitor has a context object used to poll for specific information about the device in context.

We have provided several code samples to help you in creating useful Active Script Performance Monitors for your devices.

To create a device-specific Active Script performance monitor:

  1. From the WhatsUp Gold web interface, right-click a device, then click Properties. The Device Properties dialog appears.
  2. Click Performance Monitors. The Performance Monitors information appears.
  3. Click Add. The Select Performance Monitor Type dialog appears.
  4. Select Active Script Performance Monitor, then click OK. The Add Active Script Performance Monitor dialog appears.
  5. Enter the appropriate information for the following fields:
    • 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.
    • Script Type. Enter either JSCRIPT or VBSCRIPT.
    • 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 device. This is considered a failed connection.

    Note: Though the maximum timeout allowed is 60 seconds, you are highly discouraged from using a timeout longer than the default of 10 seconds. You are encouraged to use the shortest timeout possible.

    Note: The use of reference variables in the Active Script 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.

    Note: You can add up to 10 reference variables.

    • Script text. Enter your monitor code here.
  6. Click OK to save changes.

To configure an SNMP Active Script performance monitor:

  1. On the Add Active Script Performance Monitor dialog, click Add to add a new variable to the Reference variables field. The Add New Reference Variable dialog appears.

    Note: You can add up to 10 reference variables.

    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 take care of the underlying SNMP or WMI mechanisms that you would normally have to deal with 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 a device's credentials to connect 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.

    Important: The use of reference variables in the Active Script performance monitor is optional. If you use them, you must use Context.GetReferenceVariable,for reference variables to be polled and their data graphed.

  2. Enter the appropriate information:
    • Variable name. Enter a unique name for the variable.
    • Description. (Optional) Enter additional information about the variable.
  3. Select SNMP from the Object Type list.
  4. (Optional) Enter the Timeout and Retries count for connection to the device.
  5. Click browse (...). The Select Computer dialog appears.
  6. Enter the Name or IP address of the computer to which you are trying to connect.
  7. Select the SNMP Credential used to connect to the device. You can also click browse (...) to access the Credentials Library to create a new credential.
  8. (Optional) Adjust the Timeout and Retries count for the computer to which you are trying to connect.
  9. Click OK. The SNMP MIB Browser appears.
  10. Use the navigation tree in the left panel to select the specific MIB you want to monitor. You can view more information about the property/value at the bottom of the dialog.
  11. Click OK to add the OID to the Performance counter and Instance fields in the Add New Reference Variable dialog.
  12. Verify the configuration and click OK to add the variable to the Reference variables list in the Add Active Script Performance Monitor dialog.
  13. Write or paste your monitor code in the Script text field.
  14. Click OK to save changes.

Tip: The SNMP API is useful for writing Active Script performance monitors using SNMP.

To configure a WMI Active Script performance monitor:

  1. On the Add Active Script Performance Monitor dialog, click Add to add a new variable to the Reference Variables list.

    Note: You can add up to 10 reference variables.

    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 take care of the underlying SNMP or WMI mechanisms that you would normally have to deal with 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 a device's credentials to connect 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.

    Important: The use of reference variables in the Active Script performance monitor is optional. If you use them, you must use Context.GetReferenceVariable,for reference variables to be polled and their data graphed.

  2. Enter the appropriate information:
    • Variable name. Enter a unique name for the variable.
    • Description. (Optional) Enter additional information about the variable.
  3. Select WMI from the Object Type list.
  4. Click browse (...). The Select Performance Counter dialog appears.
  5. Click browse (...) to select counters from the computer. The Select Computer dialog appears.
  6. Enter the Name or IP address of the computer in which you want to connect.
  7. Select the Windows Credential used to connect to the device. You can also click browse (...) to access the Credentials Library to create a new credential.
  8. Click OK to connect to the computer.
  9. Use the performance counter tree to navigate to the Performance Counter you want to monitor.
  10. After you select the performance counter, select the specific Performance Instance you want to monitor.
  11. Click OK to add the variable to the Performance counter field in the Add New Reference Variable dialog.
  12. Click OK to add the variable to the Reference variable list on the Add Active Script Performance Monitor dialog.
  13. Write or paste your monitor code into the Script text field.
  14. Click OK to save changes.

    Important: The first time that you poll a WMI reference variable that requires two polls in order to calculate an average (such as "Processor\% Processor Time"), it returns "Null."

See Also

Creating custom performance monitors

Creating device-specific APC UPS performance monitors

Creating device-specific PowerShell Scripting performance monitors

Example - PowerShell performance monitor scripts

Creating device-specific SNMP performance monitors

Creating device-specific Printer performance monitors

Creating device-specific SQL Query performance monitors

SQL Query Builder

Creating device-specific SSH performance monitors

Creating device-specific WMI Formatted Counter performance monitors

Creating device-specific WMI performance monitors

Example: monitoring router bandwidth

Example: troubleshooting a slow network connection