Dynamic Group - Devices Without Action Policy

Good Afternoon everyone,
I apologize if this quesiton has already been answered. I'm looking for a quick way to view devices that do not have action policies attached. I'm currently using Dynamic Groups to look at Systems with specific action policies. For example:
SELECT DISTINCT Device.nDeviceID
FROM Device
JOIN ActionPolicy
ON Device.nActionPolicyID = ActionPolicy.nActionPolicyID
WHERE ActionPolicy.sPolicyName LIKE N'%Generic Priority%'
AND Device.bRemoved = 0
And this works great for specific priorities, but for auditing purposes, I'd like to be able to see if there are any systems that were added without action policies.
What might be easier (and more accurate for what I'm looking for) is to be able to display devices that do not have specific action policies applied. For example: Let's say we have a total of 5 action policies that we utilize. Could we say something like "WHERE ActionPolicy.sPolicyName NOT LIKE N'%Priority1%' or N'%Priority2%'" etc etc?
Thank you for any help you can supply.
~Jeeves
- 879 views
- 1 version
- 1 reply
- 0 followers
- Post Date:
- April 5, 2011
- Posted By:
- Jeeves Murphy
About this forum
- 142k views
- 2222 topics
- 55 followers
Post questions and find answers for all things related to the Standard and Premium Editions of WhatsUp gold.
Page Options
1 Reply
http://community.whatsupgold.com/script_library/dynamicgroups/deviceswithnoactionsassigned
[Originally posted by Kerry Myers1568]
Used to identify devices which have no actions assigned to the device or any of the active monitors on that device.
SELECT Device.nDeviceID
FROM Device
LEFT OUTER JOIN ActionPolicy
ON Device.nActionPolicyID = ActionPolicy.nActionPolicyID
LEFT OUTER JOIN PivotActiveMonitorTypeToDevice
ON Device.nDeviceID = PivotActiveMonitorTypeToDevice.nDeviceID
LEFT OUTER JOIN ActionPolicy AP
ON PivotActiveMonitorTypeToDevice.nActionPolicyID =
AP.nActionPolicyID
WHERE Device.bRemoved = 0
AND ActionPolicy.sPolicyName IS NULL
GROUP BY Device.nDeviceID
Having MAX(AP.sPolicyName) IS NULL
Would you like to comment?
You must be a member. Sign In if you are already a member.