I have a problem with the SQL query to create a dynamic group.
What I want is to create a dynamic group with a spesific active monitor with status down.
The provided examples show how to filter on a spesific active monitor, but I don't know how to add a additional filter on status down.
SELECT DISTINCT Device.nDeviceID FROM DeviceJOIN MonitorState ON Device.nWorstStateID = MonitorState.nMonitorStateID LEFT OUTER JOIN PivotActiveMonitorTypeToDevice ON PivotActiveMonitorTypeToDevice.nDeviceID = Device.nDeviceID LEFT OUTER JOIN ActiveMonitorType ON ActiveMonitorType.nActiveMonitorTypeID = PivotActiveMonitorTypeToDevice.nActiveMonitorTypeID WHERE Device.bRemoved = 0 AND ActiveMonitorType.sMonitorTypeName LIKE N'%_XXXXX_%' ANDMonitorState.nInternalMonitorState = 1
Make sure you replace _XXXXX_ with the name of the active monitor you want to filter on.
It works.
Thanks.