Recently someone posted a script that will show a nodes Map assignment and Nodes Group assignments. I searched the user groups and was not able to relocate it.
I don't recall that post, but here's the one we use:
SELECT CASE WHEN m.Container.Owner = 'Core' THEN 'Group' WHEN m.Container.Owner = 'Maps' THEN 'Map' ELSE 'Other' END AS [Type], CASE WHEN m.Container.Owner = 'Core' THEN m.Container.Name WHEN m.Container.Owner = 'Maps' THEN p.DisplayName ELSE 'Other' END AS [Name], m.Container.DetailsURL AS [_linkfor_Name], s.StatusName AS [Status], '/Orion/images/StatusIcons/Small-' + s.StatusName + '.gif' AS [_iconfor_Status]FROM Orion.ContainerMembers mJOIN Orion.StatusInfo s ON m.Container.Status = s.StatusIDLEFT JOIN Orion.Maps.Projects p ON m.Container.Name = p.ProjectIDWHERE m.MemberEntityType = 'Orion.Nodes' AND m.MemberPrimaryID = ${NodeID}
And that looks like this:
Ahh, you bet me to it @stuartd . But I had to create it from scratch :-D
Here is my suggestion. Looks pretty much the same but I have another approach on the status icon.
SELECT M.Container.DisplayName AS [Group] ,CASE WHEN M.Container.Owner='Core' THEN 'Group' WHEN M.Container.Owner='Maps' THEN 'Map' END AS [Type] ,M.Container.DetailsUrl AS [_LinkFor_Group] ,CONCAT('/Orion/StatusIcon.ashx?entity=Orion.Groups&status=',M.Container.Status) AS [_IconFor_Group]FROM Orion.ContainerMembers as MWHERE M.MemberEntityType='Orion.Nodes' AND M.MemberPrimaryID=${NodeID}ORDER BY M.Container.DisplayName
Thanks for scripts, much appreciated.
Oh nice - I like that as well.
If you could mark mine or Thomas's answers as correct then that would be helpful for the community. Thanks,