Hello there! I am trying to create a report that will show hosts that are not in a group. How would this be done?
SELECT n.NodeID, n.Caption, n.IP_AddressFROM SolarWinds.dbo.Nodes nWHERE n.NodeID NOT IN (SELECT cms.EntityID FROM SolarWinds.dbo.ContainerMemberSnapshots cms JOIN SolarWinds.dbo.Containers c ON c.ContainerID = cms.ContainerID WHERE cms.EntityType = 'Orion.Nodes' AND c.Name = 'YOUR GROUP NAME' )
SELECT
n.NodeID, n.Caption, n.IP_Address
FROM SolarWinds.dbo.Nodes n
WHERE
n.NodeID NOT IN
(
SELECT cms.EntityID
FROM SolarWinds.dbo.ContainerMemberSnapshots cms
JOIN SolarWinds.dbo.Containers c ON c.ContainerID = cms.ContainerID
cms.EntityType = 'Orion.Nodes' AND
c.Name = 'YOUR GROUP NAME'
)
Alex - Thank you VERY much. I was unclear however, I am looking for hosts that belong to no groups, not a specific group. How would I do that?
Pleasure. To do this simply remove last line "c.Name = 'YOUR GROUP NAME'" and also remove "AND" and the end of the previous line
So I followed you instructions (I think lol) and I got invalid Query. I cut and pasted the text in you original response and of course replaced it with a group name. It failed. I then remove the AND plus that last lint before the ) and that failed as well. Any advice?
did you change database name? it appears 2 time as "SolarWinds". Default is "SolarWindsOrion" if you haven't change it during install
I did not, i just cut and pasted what you had. I did not change any default databases during install.
Where do I change this?
You need to replace "SolarWinds" database name in the code to be your database name. Check your SQL server how it is called or try "SolarWindsOrion" - hope it will works
see below. I have also removed JOIN which was used to join group names.
Now you can copy-paste...
SELECT n.NodeID, n.Caption, n.IP_AddressFROM SolarWindsOrion.dbo.Nodes nWHEREn.NodeID NOT IN(SELECT cms.EntityID FROM SolarWindsOrion.dbo.ContainerMemberSnapshots cms WHERE cms.EntityType = 'Orion.Nodes')
FROM SolarWindsOrion.dbo.Nodes n
FROM SolarWindsOrion.dbo.ContainerMemberSnapshots cms
cms.EntityType = 'Orion.Nodes'
You are the best! Thank you so much for taking the time for a newbie
my pleasure