Configuring Active Script performance monitors
- Last Updated: April 2, 2026
- 5 minute read
- WhatsUp Gold
- Version 2026
The Active 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. For more information, see Scripting Performance Monitors.
The Active Script performance monitor requires one or more of the following credentials:
- SNMPv1
- SNMPv2
- SNMPv3
- WMI
Configure the Active Script performance monitor using the following boxes:
- Name. Enter a unique name for the performance monitor. This name displays in the Monitor Library.
- Script type. Select either JSCRIPT or VBSCRIPT.
- Description. (Optional) Enter a short description for the performance monitor. This description displays next to the performance monitor in the 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: Though the maximum timeout allowed is 60 seconds, Ipswtich does not recommend
setting a timeout exceeding 10 seconds. You are encouraged to use the shortest timeout
possible.
- Reference variables. Add, edit, or remove SNMP and WMI reference
variables using the respective buttons on the right of the dialog. See the steps
below to configure either an SNMP or WMI Active Script Performance monitor.Note: 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. 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.Note: By using theContext.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.Note: You can add up to 10 reference variables. - Script text. Enter your monitor code here.
- Click OK to save changes. The custom performance monitor displays in the Monitor Library list.
To configure an SNMP Active Script performance monitor:
- Click Add from the Add Active Script Performance Monitor dialog to add a new variable to the Reference variables field. The Add New Reference Variable dialog appears. 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. - Enter the appropriate information:
- Variable name. Enter a unique name for the variable.
- Description. (Optional) Enter a short description for the variable.
- Select SNMP from the Object type list.
- Enter the Timeout and Retries count for connection to the device. These are optional field entries.
- Click browse (...) next to Instance. The MIB Browser dialog appears.
- Enter the name or IP address of the computer you are you are trying to connect to in the Select counters from computer box. You can click browse (...) to select a device from a list.
- 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.
- Adjust the length of time and the number of retries for the computer you are trying to connect to in the Timeout and Number of retries boxes.
- Click OK. The SNMP MIB Browser appears.
- 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.
- Click OK to add the OID to the Performance counter and Instance fields in the Add New Reference Variable dialog.
- Verify the configuration and click OK to add the variable to the Reference variables list in the Add Active Script Performance Monitor dialog.
- Write or paste your monitor code in the Script text field.
- 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:
- Click Add from the Add Active Script Performance Monitor dialog to add a new variable to the Reference variables field. The Add New Reference Variable dialog appears. 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. - Enter the appropriate information:
- Variable name. Enter a unique name for the variable.
- Description. (Optional) Enter a short description for the variable.
- Select WMI from the Object Type list.
- Click browse (...) next to Instance. The Performance Counters dialog appears.
- Enter the Name or IP address of the computer you are trying to connect. You can click browse (...) to select a device from a list.
- 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.
- Click OK to connect to the computer.
- Use the performance counter tree to navigate to the Performance Counter you want to monitor.
- Select the specific Performance Instance you want to monitor.
- Click OK to add the variable to the Performance counter field in the Add New Reference Variable dialog.
- Click OK to add the variable to the Reference variable list on the Add Active Script Performance Monitor dialog.
- Write or paste your monitor code into the Script text field.
- 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."