Note: 此範例僅供說明之用,本公司不提供技術支援。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);
}