Active Script (Performance)
- Last Updated: July 25, 2023
- 4 minute read
- WhatsUp Gold
The Active Script Performance monitor enables you to write VBScript and JScript to easily poll one or more SNMP or WMI values, perform math or other operations on those values, and graph a single output value. You should only use the Active Script Performance Monitor when you need to perform calculations on the polled values. Keep in mind that although you can poll multiple values using the feature, only one value will be stored to the database: the outcome of your scripted calculation.
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.
- Description. (Optional) Enter a short description for the performance monitor. This description displays next to the performance monitor in the Monitor library.
- Script type. Select either JScript or VBScript.
- Timeout. Enter the length of time WhatsUp Gold attempts to connect to the selected device.
- Polling interval. Specify how often WhatsUp Gold should request updated information from the device.
- Reference variables. Add, Edit, or Remove SNMP and WMI reference variables . Please note, the use of reference variables in the Active Script performance monitor is optional. For additional information, please see Using Reference Variables with Script Monitors.
- Script text. Enter your monitor code.
To configure an SNMP Active Script performance monitor:
- Click
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. - Enter the appropriate information:
- Variable name. Enter a unique name for the variable.
- Description. (Optional) Enter a short description for the variable.
- Select the SNMP radio button.
- Enter the Timeout and Retries count for connection to the device. These are optional field entries.
- Click Select to launch the MIB Browser.
- 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.
- Use the navigation tree 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.
To configure a WMI Active Script performance monitor:
- Click
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. - Enter the appropriate information:
- Variable name. Enter a unique name for the variable.
- Description. (Optional) Enter a short description for the variable.
- Select the WMI radio button.
- Click Select to launch the MIB Browser.
- 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 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.
- Use the navigation tree 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.
Keep In Mind
- You need to include error handling in your monitor script. Your script either needs a value to graph by using
Context.SetValue, or you must useContext.SetResultto tell WhatsUp Gold that the script failed. Context.GetReferenceVariablewill return 'null' if the poll fails for any reason.- If you do not have a call to
SetValueorSetResult, the script does not report any errors and no data is graphed. - If
SetValueis used, it is not necessary to useSetResult, asSetValueimplicitly setsSetResultto 0, or "good." - Results from this performance monitor are displayed on Custom Performance Monitors full and dashboard reports.
- Errors from this performance monitor are displayed in the Performance Monitor Error log, as well as EventViewer.exe.