Showing "Manually Assigned" as True against some Site Servers
search cancel

Showing "Manually Assigned" as True against some Site Servers

book

Article ID: 385781

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

The "Site Servers" report is showing "Manually Assigned" as True against some Site Servers.

You are trying to clarify how "Manually Assigned" is determined under the "Site Servers" report (Reports > Notification Server Management > Server > Subnets and Sites Info > Site Servers).

Your concern here is that you don't recall if you or someone in your team has or has not manually assigned these Site Servers to any Site. There are a couple of Site Servers showing this status. 



When you look at the actual Site Server, it shows the "Manually Assigned" checkbox as grayed out.

 

Environment

ITMS 8.x, 8.7.x

Cause

-- Identifies the site a specific computer falls into.

SELECT DISTINCT 
c.Name as Computer, 
ip.[IP Address], 
isnull(rms.Name, ip.Subnet+'   {No subnet object exists}') as Subnet, 
isnull(sub.[Subnet Mask], '') as [Subnet Mask], 
ISNULL(clients.cnt,0) as [Clients in Subnet],
isnull(ste.name,'') as [Site by Subnet Assignment], 
ISNULL(cts.cnt, 0)  as [Manually Assigned Sites],
case when ts.ChildResourceGuid is null then 'No' else 'Yes' end as [Is a Task Server],
case when ps.ChildResourceGuid is null then 'No' else 'Yes' end as [Is a Package Server],
cc.LastConfig,
c.guid

FROM vRM_Computer_Item c
join CollectionMembership cm on cm.ResourceGuid = c.Guid and cm.CollectionGuid = 'A103BB94-B956-4440-AF2A-CE8030F5D9A9'  /*  uncomment for site servers only*/
join Inv_AeX_AC_TCPIP ip on ip._ResourceGuid = c.Guid
left join vSubnet sub on sub.Subnet = ip.Subnet
left join RM_ResourceSubnet rms on rms.Guid = sub.Guid
left join
(select distinct vs.Guid, vs.Subnet, vs.[Subnet Mask], cnt=COUNT(*)
 from vSubnet vs
 join Inv_AeX_AC_TCPIP tcp on tcp.Subnet = vs.Subnet and tcp.[Subnet Mask] = vs.[Subnet Mask]
 group by vs.Guid, vs.Subnet, vs.[Subnet Mask]
) clients on clients.Guid = rms.Guid

left join
(select distinct ra.ParentResourceGuid, cnt=count(*)
 from ResourceAssociation ra
-- join vSite s on s.Guid = ra.ChildResourceGuid
 where ra.ResourceAssociationTypeGuid = '5E8E3C61-A80C-4B0A-A228-DBF97607CEE4' --    Computer To Site
 group by ra.ParentResourceGuid
)cts on cts.ParentResourceGuid = c.Guid

left join ResourceAssociation ra1 on ra1.ChildResourceGuid = sub.Guid
  and ra1.ResourceAssociationTypeGuid = 'F71ABA8C-8823-44C8-A750-F03DE84DC5F6' -- Site To Subnet
left join vSite ste on ste.Guid = ra1.ParentResourceGuid

left join
(select ResourceGuid, LastConfig = MAX(_eventTime)
from Evt_NS_Client_Config_Request
group by ResourceGuid
)cc on cc.ResourceGuid = c.Guid

left join 
( select distinct ra.ChildResourceGuid
from  ResourceAssociation ra
join RM_ResourceTaskService ts on ts.Guid = ra.ParentResourceGuid and ts.Deleted = 0
where ra.ResourceAssociationTypeGuid = '5F00E96B-93F3-41F0-94A7-7DBBB8AEF841'-- Site Service to Computer
) ts on ts.ChildResourceGuid = c.Guid 

left join 
( select distinct ra.ChildResourceGuid
from  ResourceAssociation ra
join RM_ResourcePackageService ps on ps.Guid = ra.ParentResourceGuid and ps.Deleted = 0
where ra.ResourceAssociationTypeGuid = '5F00E96B-93F3-41F0-94A7-7DBBB8AEF841'-- Site Service to Computer
) ps on ps.ChildResourceGuid = c.Guid 


where c.IsManaged = 1 
order by 1,6

Resolution

There is SQL procedure: spGetManualSiteServerSiteAssignments - it returns all manually assigned site servers.

In short, the computer of site server should have association 'Computer To Site' (5e8e3c61-a80c-4b0a-a228-dbf97607cee4).

    SELECT    vc.[Guid],
              vs.[Guid] AS [SiteGuid]  
        FROM  vComputerResourceEx vc
        JOIN  ResourceAssociation ra ON ra.ParentResourceGuid = vc.[Guid]
                                    AND ra.ResourceAssociationTypeGuid = '5E8E3C61-A80C-4B0A-A228-DBF97607CEE4'
        JOIN  vSite               vs ON vs.[Guid] = ra.ChildResourceGuid
        WHERE vc.IsLocal = 1

 

As for the grayed checkbox in UI - this is because it's not editable "in place", just a value.

The assignment is done by a button in the toolbar:

Un-assign can be done by "X" button in the toolbar:



Note:

Question:
If you haven't "directly/manually" assigned a Site Server to a Site, do we automatically flag the Site Server as "manually assigned" if its subnet falls in an encompassed subnet?

Answer:
No. There is not currently a single place in the code that will do it automatically. That is done from UI at this point.