Configure Active Script Performance Monitor

How to get here

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

This script performance monitor has a context object that you can use 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 configure an SNMP active script performance monitor:

  1. On the Add Active Script Performance Monitor dialog, enter a Name and Description for the monitor as it will appear in the Performance Monitor Library.
  2. Enter a number for the timeout (in minutes). And for the device-specific Active Script Performance Monitor, enter a number (in minutes) for the Collection interval.
  3. Choose the type of script (JScript or VBScript) you will be using to write the monitor from the Script type drop down menu.
  4. Add a new variable to the Reference Variables list by clicking Add.

    Important: You can add up to 100 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 will use a device's credentials and 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 do use them, you must use Context.GetReferenceVariable,for reference variables to be polled and their data graphed.

  5. On the Add reference variables dialog, enter a name and description for the variable.
  6. Select the type of object (SNMP) from the Object type drop-down menu.
  7. If needed, adjust the Timeout and Retries count for connection to the device.
  8. Click the Browse (...) button next to the Instance box. The SNMP MIB Browser appears.
  9. Enter the share name or IP address of the computer in which you are trying to connect.
  10. Enter the SNMP credential used to connect to the device (or click the Browse (...) button to access the Credentials Library to create a new credential.)
  11. If needed, adjust the Timeout and Retries count for the computer in which you are trying to connect.
  12. Click OK. The SNMP MIB Walker appears.
  13. 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.
  14. Click OK to add the OID to the Performance counter and Instance box in the Add new reference variable dialog.
  15. Verify the configuration and click OK to add the variable to the Reference variable list on the Add active script performance monitor dialog.
  16. Write or paste your monitor code in the Script text box.
  17. Click OK to save changes and add the monitor to the Performance Monitor Library.

Tip: The SNMP API is useful for writing Active Script Performance Monitors using SNMP. For more information, see Using the SNMP API.

To configure a WMI active script performance monitor:

  1. On the Add Active Script Performance Monitor dialog, enter a Name and Description for the monitor as it will appear in the Performance Monitor Library.
  2. Enter a number for the timeout (in minutes), and for the device-specific Active Script Performance Monitor, enter a number (in minutes) for the Collection interval.
  3. Choose the type of script (JScript or VBScript) you will be using to write the monitor from the Script type drop down menu.
  4. Add a new variable to the Reference Variables list by clicking Add.

    Important: 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 will use a device's credentials and 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 do use them, you must use Context.GetReferenceVariable,for reference variables to be polled and their data graphed.

  5. On the Add reference variables dialog, enter a name and description for the variable.
  6. Select the type of object (WMI) from the Object type drop-down menu.
  7. Click the Browse (...) button next to the Instance box. The Performance Counters dialog appears.
  8. Enter the computer name or IP address of the computer in which you want to connect.
  9. Select a credential from a list of Windows credentials (pulled from the Credentials Library), then click OK to connect to the computer.
  10. Use the Performance counter tree to navigate to the performance counter you want to monitor.
  11. Once you select the performance counter, select the specific instance you want to monitor.
  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 in the Script text box.
  14. Click OK to save changes and to add the monitor to the Performance Monitor Library.

Warning: 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 will return "Null."