<注意> 此范例仅供说明之用,本公司不提供技术支持。Ipswitch 为内容对象、SNMP API 和脚本环璄提供技术支持服务,但不对 JScript、VBScript,或活动脚本监控工具或操作的开发及侦错提供支持服务。如需此范例或自行编写脚本方面的协助,请造访 WhatsUp Gold 用户社群论坛。
此操作会重设所有设备的认可旗标。若尚未认可设备的状态,图标上的卷标会显现黑底白字。若您未使用认可功能,可利用此操作让图标保持在已认可状态。
// This JScript action sets the acknowledge flag to true for all devices.
// Written by Tim Schreyack of Dynamics Research Corporation
// Get the database info
var oDb = Context.GetDB;
if (null == oDb) {
Context.SetResult( 1, "Problem creating the DB object");
}
else {
var sSql = "UPDATE ActiveMonitorStateChangeLog SET bAcknowledged = 1 WHERE bAcknowledged = 0";
var oRs = oDb.Execute(sSql);
var sSql = "UPDATE Device SET nUnAcknowledgedActiveMonitors = 0 WHERE nUnAcknowledgedActiveMonitors = 1";
var oRs = oDb.Execute(sSql);
var sSql = "UPDATE Device SET nUnAcknowledgedPassiveMonitors = 0 WHERE nUnAcknowledgedPassiveMonitors = 1";
var oRs = oDb.Execute(sSql);
}