Adding and editing an Active Script Performance Monitor
- Last Updated: August 28, 2024
- 12 minute read
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 add a new Active Script performance monitor:
-
- 从 网页界面进入管理 > 监控工具。此时会出现 “监控工具库” 对话框。
- 单击 “性能” 选项卡。此时会出现“性能监控工具”列表。
- 单击 “新建”。此时会出现 “选择性能监控工具类型” 对话框。
-
- 输入或选择适当信息:
- Name. Enter a unique name for the performance monitor. This name displays in the Performance Monitor Library.
- Description. Enter additional information about the monitor. This description displays next to the monitor in the Performance Monitor Library.
- Script Type. Select either JSCRIPT or VBSCRIPT.
- Timeout (sec).
输入 尝试连接所选设备的时间长度。若超过您输入的时间后仍未连接,则发生超时并且 停止连接 SMTP 服务器。这被视为连接失败。
注: 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. - Reference variables. Add, edit, or
remove SNMP and WMI reference variables using the respective
buttons on the right of the dialog.注: 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 manage to access SNMP or WMI counters on a remote device.注: By using theContext.GetReferenceVariable(variable name), you only need to specify the name of a pre-defined variable. 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. - Script text. Enter your monitor code here.
-
单击确定以保存更改。
-
- After the monitor has been added to the library, you can enable the monitor through Device Properties > Performance Monitors. For more information, see Enabling performance monitors.
注: 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."
Troubleshooting
Having problems with your WMI monitor returning false negatives?
To edit an existing Active Script performance monitor:
-
- 从 网页界面进入管理 > 监控工具。此时会出现 “监控工具库” 对话框。
- 单击 “性能” 选项卡。此时会出现“性能监控工具”列表。
- 在目前的监控工具列表中,选择您要编辑的性能监控工具,然后单击 “编辑”。
-
- 输入或选择适当信息:
- Name. Enter a unique name for the performance monitor. This name displays in the Performance Monitor Library.
- Description. Enter additional information about the monitor. This description displays next to the monitor in the Performance Monitor Library.
- Script Type. Select either JSCRIPT or VBSCRIPT.
- Timeout (sec).
输入 尝试连接所选设备的时间长度。若超过您输入的时间后仍未连接,则发生超时并且 停止连接 SMTP 服务器。这被视为连接失败。
注: 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. - Reference variables. Add, edit, or
remove SNMP and WMI reference variables using the respective
buttons on the right of the dialog.注: 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 theContext.GetReferenceVariable(variable name), you only need to specify the name of a pre-defined variable. 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. - Script text. Enter your monitor code here.
-
单击确定以保存更改。