Active Script Performance Monitors let you 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.
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 do use them, you must use Context.GetReferenceVariable,
for reference variables to be polled and their data graphed.
Context.SetValue
, or you must use Context.SetResult
to tell WhatsUp Gold that the script failed.Context.GetReferenceVariable
will return 'null' if the poll fails for any reason.SetValue
or SetResult
, the script does not report any errors and no data is graphed.SetValue
is used, it is not necessary to use SetResult
, as SetValue
implicitly sets SetResult
to 0, or "good."