WhatsUp Gold 预先配置了动态组示例,您可以在“设备”选项卡的网页界面下查看这些示例。如需这些群组的详细信息,请参阅创建动态群组

下例列出的几个动态群组过滤条件,可让您为设备建立实用的动态群组。若要使用这些范例,请选择过滤条件的文本,然后复制并贴到 “动态群组” 对话框的 “过滤条件” 对话框中。

注: 从说明文件复制程序代码时若出现版权信息,最好移除贴上的版权信息。

显示过去三小时内状态有所变更的所有设备:

SELECT DISTINCT Device.nDeviceIDFROM   Device       JOIN PivotActiveMonitorTypeToDevice         ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID       JOIN ActiveMonitorStateChangeLog         ON PivotActiveMonitorTypeToDevice.nPivotActiveMonitorTypeToDeviceID =              ActiveMonitorStateChangeLog.nPivotActiveMonitorTypeToDeviceIDWHERE  Device.bRemoved = 0        AND DATEDIFF(Hh,ActiveMonitorStateChangeLog.dStartTime,GETDATE()) <= 3

显示安装多个接口的所有设备:

SELECT DISTINCT NetworkInterface.nDeviceID FROM Device          JOIN NetworkInterface            ON Device.nDeviceID = NetworkInterface.nDeviceID WHERE    Device.bRemoved = 0 GROUP BY NetworkInterface.nDeviceID HAVING   COUNT(NetworkInterface.nDeviceID) > 1

显示从过去两小时内脱机到现在的所有设备:

SELECT DISTINCT Device.nDeviceID FROM 	Device 	JOIN PivotActiveMonitorTypeToDevice 	  ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID 	JOIN ActiveMonitorStateChangeLog         ON PivotActiveMonitorTypeToDevice.nPivotActiveMonitorTypeToDeviceID =              ActiveMonitorStateChangeLog.nPivotActiveMonitorTypeToDeviceID       JOIN MonitorState         ON Device.nWorstStateID = MonitorState.nMonitorStateID WHERE Device.bRemoved = 0 	AND PivotActiveMonitorTypeToDevice.bDisabled = 0 	AND DATEDIFF(hh, ActiveMonitorStateChangeLog.dStartTime, GETDATE()) <= 2 	AND MonitorState.nInternalMonitorState = 1

显示过去两天内有触发操作的所有设备 (在特定群组中):

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN ActionActivityLog          ON Device.nDeviceID = ActionActivityLog.nDeviceID        JOIN PivotDeviceToGroup          ON Device.nDeviceID = PivotDeviceToGroup.nDeviceID        JOIN DeviceGroup          ON PivotDeviceToGroup.nDeviceGroupID = DeviceGroup.nDeviceGroupID WHERE  Device.bRemoved = 0        AND DATEDIFF(Dd,ActionActivityLog.dDateTime,GETDATE()) <= 2        AND DeviceGroup.sGroupName = 'My Key Resources Group'

显示需要确认的所有设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN PivotActiveMonitorTypeToDevice          ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID        JOIN ActiveMonitorStateChangeLog          ON PivotActiveMonitorTypeToDevice.nPivotActiveMonitorTypeToDeviceID =               ActiveMonitorStateChangeLog.nPivotActiveMonitorTypeToDeviceID WHERE  Device.bRemoved = 0        AND ActiveMonitorStateChangeLog.bAcknowledged = 0        AND PivotActiveMonitorTypeToDevice.bRemoved = 0

显示磁盘使用量在 90% 以上的所有设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN PivotStatisticalMonitorTypeToDevice          ON Device.nDeviceID = PivotStatisticalMonitorTypeToDevice.nDeviceID        JOIN StatisticalDiskIdentification          ON PivotStatisticalMonitorTypeToDevice.nPivotStatisticalMonitorTypeToDeviceID =               StatisticalDiskIdentification.nPivotStatisticalMonitorTypeToDeviceID        JOIN StatisticalDiskCache          ON StatisticalDiskIdentification.nStatisticalDiskIdentificationID =               StatisticalDiskCache.nStatisticalDiskIdentificationID WHERE  Device.bRemoved = 0        AND PivotStatisticalMonitorTypeToDevice.bEnabled = 1        AND StatisticalDiskCache.nDataType = 1        AND (((nUsed_Avg / nSize) > 0.90)             AND (NOT nSize = 0                   OR nSize IS                      NULL))

显示所有维护中设备,或至少有一个主动监控工具脱机且符合指定设备类型的所有设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN MonitorState          ON Device.nWorstStateID = MonitorState.nMonitorStateID WHERE  Device.bRemoved = 0        AND MonitorState.nInternalMonitorState IN (1,2)        AND Device.nDeviceTypeID IN (3,4,38,63,64,65,66,67,68,71,72) 

显示所有主动监控工具都脱机的设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN MonitorState          ON Device.nWorstStateID = MonitorState.nMonitorStateID WHERE  Device.bRemoved = 0        AND MonitorState.nInternalMonitorState = 1        AND Device.nWorstStateID = Device.nBestStateID 

显示所有主动监控工具都脱机 20 分钟以上的设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN PivotActiveMonitorTypeToDevice          ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID        JOIN ActiveMonitorStateChangeLog          ON PivotActiveMonitorTypeToDevice.nPivotActiveMonitorTypeToDeviceID =               ActiveMonitorStateChangeLog.nPivotActiveMonitorTypeToDeviceID        JOIN MonitorState          ON PivotActiveMonitorTypeToDevice.nMonitorStateID =               MonitorState.nMonitorStateID WHERE  Device.bRemoved = 0        AND PivotActiveMonitorTypetoDevice.bRemoved = 0        AND PivotActiveMonitorTypeToDevice.bDisabled = 0        AND MonitorState.nInternalMonitorState = 1        AND DATEDIFF(Mi,ActiveMonitorStateChangeLog.dStartTime,GETDATE()) >= 20        AND Device.nWorstStateId = Device.nBestStateId 

显示特定性能监控工具所属的设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN PivotStatisticalMonitorTypeToDevice          ON Device.nDeviceID = PivotStatisticalMonitorTypeToDevice.nDeviceID        JOIN StatisticalMonitorType          ON StatisticalMonitorType.nStatisticalMonitorTypeID =               PivotStatisticalMonitorTypeToDevice.nStatisticalMonitorTypeID WHERE  Device.bRemoved = 0        AND PivotStatisticalMonitorTypeToDevice.bEnabled = 1        AND StatisticalMonitorType.sStatisticalMonitorTypeName             LIKE '%Interface Utilization%'

显示特定被动监控工具所属的设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN PivotPassiveMonitorTypeToDevice          ON Device.nDeviceID = PivotPassiveMonitorTypeToDevice.nDeviceID       JOIN PassiveMonitorType         ON PassiveMonitorType.nPassiveMonitorTypeID =              PivotPassiveMonitorTypeToDevice.nPassiveMonitorTypeID WHERE  Device.bRemoved = 0       AND PivotPassiveMonitorTypeToDevice.bRemoved = 0       AND PassiveMonitorType.sMonitorTypeName LIKE '%Cold Start%'

显示特定主动监控工具所属的设备:

SELECT DISTINCT Device.nDeviceIDFROM   Device       JOIN PivotActiveMonitorTypeToDevice         ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID        JOIN ActiveMonitorType          ON ActiveMonitorType.nActiveMonitorTypeID =              PivotActiveMonitorTypeToDevice.nActiveMonitorTypeID WHERE  Device.bRemoved = 0       AND PivotActiveMonitorTypeToDevice.bRemoved = 0       AND ActiveMonitorType.sMonitorTypeName LIKE '%Ping%'

依据显示名称、主机名或 IP 地址寻找设备:

SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN NetworkInterface          ON Device.nDeviceID = NetworkInterface.nDeviceID             AND Device.nDefaultNetworkInterfaceID =                   NetworkInterface.nNetworkInterfaceID        JOIN DeviceType          ON Device.nDeviceTypeID = DeviceType.nDeviceTypeID WHERE  (Device.sDisplayName LIKE '%Mail Server%'          OR NetworkInterface.sNetworkName LIKE '%server1.ipswitch.com%'          OR NetworkInterface.sNetworkAddress LIKE '%1.2.3.4%')        AND Device.bRemoved = 0 

显示操作 (或主动监控工具的操作) 名称中有特定字词的设备:

注: 若要搜索其他操作,请变更 LIKE 后面的操作名称。请记得保留两个 % 符号。
SELECT DISTINCT Device.nDeviceIDFROM   Device       JOIN ActionPolicy		 ON Device.nActionPolicyID = ActionPolicy.nActionPolicyID        JOIN PivotActionTypeToActionPolicy 		 ON ActionPolicy.nActionPolicyID =  			PivotActionTypeToActionPolicy.nActionPolicyID 		JOIN ActionType 		  ON PivotActionTypeToActionPolicy.nActionTypeID = 			 ActionType.nActionTypeID WHERE  Device.bRemoved = 0        AND ActionType.sActionTypeName LIKE '%Critical%' UNION SELECT DISTINCT Device.nDeviceID FROM   Device        JOIN PivotActiveMonitorTypeToDevice          ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID        JOIN ActionPolicy          ON PivotActiveMonitorTypeToDevice.nActionPolicyID =                ActionPolicy.nActionPolicyID        JOIN PivotActionTypeToActionPolicy          ON ActionPolicy.nActionPolicyID =                PivotActionTypeToActionPolicy.nActionPolicyID        JOIN ActionType          ON PivotActionTypeToActionPolicy.nActionTypeID =                ActionType.nActionTypeID WHERE  Device.bRemoved = 0        AND PivotActiveMonitorTypeToDevice.bRemoved = 0        AND ActionType.sActionTypeName LIKE '%Critical%'UNIONSELECT DISTINCT Device.nDeviceIDFROM   Device       JOIN ActionPolicy	 ON  ActionPolicy.nActionPolicyID=0 and bGlobalActionPolicy=1       JOIN PivotActionTypetoActionPolicy P	 ON P.nActionPolicyID = ActionPolicy.nActionPolicyID       JOIN [ActionType]	 ON P.nActionTypeID = ActionType.nActionTypeIDWHERE  ActionType.sActionTypeName LIKE '%Critical%'