search cancel

How is a relay agent selected in Notification Server for Wake on Lan?


Article ID: 179735


Updated On:


IT Management Suite




What is the criteria or process that is used in consideration for choosing a Wake on Lan 'relay agent' using the Notification Server?

The criteria for selecting a relay agent are as follows:

First is to check and see if a computer has a role of NS, PS or simply the Altiris Agent is installed. Notification Server is given a higher priority and then Package Servers and then down to just having the Altiris Agent installed.
Then is a check for the ownernsguid of the agent to see if it matches the Notification Server guid in VthisNS
The computer also needs to be managed locally  'IsManaged = 1'
An IP address needs to be retrieved from Inv_AeX_AC_TCPIP it cannot be Null, '', or ''
There also needs to be a valid subnet.  Not Null or ''
The MAC Address is checked as well and cannot be Null or '00-00-00-00-00-00'
The Default Gateway cannot be '' and the Subnet cannot be '' 
The tables Evt_NS_Client_Config_Request and Evt_NS_Event_History are checked for the most recent agent communication

Below is the actual Query that is used for the process of selecting a Relay Agent.

sELECT DISTINCT vc.Guid, tcp.*,
WHEN r.Role = 'Notification Server' THEN 3
WHEN ca.[Agent Name] = 'Package Server' THEN 2
WHEN ca.[Agent Name] = 'Altiris Agent' THEN 1
END [priority]
INTO #potentialTmpTable
FROM vComputerResource vc
INNER JOIN Inv_AeX_AC_Roles r ON r._ResourceGuid = vc.Guid
INNER JOIN Inv_AeX_AC_Client_Agent ca ON ca._ResourceGuid = vc.Guid
INNER JOIN Inv_AeX_AC_TCPIP tcp ON tcp._ResourceGuid = vc.Guid
INNER JOIN Item i on i.Guid = vc.Guid
WHERE (r.Role = 'Notification Server' OR ca.[Agent Name] = 'Package Server' OR ca.[Agent Name] = 'Altiris Agent')
AND i.OwnerNSGuid = (SELECT Guid FROM vThisNS)
AND vc.[IsManaged] = 1
AND tcp.[Subnet] IN (SELECT [Subnet] FROM #pmtmp)
( tcp.[IP Address] IS NOT NULL and tcp.[IP Address] <> '' and tcp.[IP Address] <> '' and tcp.[IP Address] <> '' ) and
( tcp.[Subnet] IS NOT NULL and tcp.[Subnet] <> '' and tcp.[Subnet] <> '' ) and
( tcp.[MAC Address] IS NOT NULL and tcp.[MAC Address] <> '' and tcp.[MAC Address] <> '00-00-00-00-00-00' ) and
( tcp.[Default Gateway] <> '' ) and ( tcp.[Subnet Mask] <> '' )
order by priority desc
SELECT a.*, evt.[_eventTime] from #potentialTmpTable a
SELECT et.[ResourceGuid], MAX( et.[_eventTime] ) AS [_eventTime]
SELECT [ResourceGuid], MAX( [_eventTime] ) AS [_eventTime] FROM
GROUP BY [ResourceGuid]
SELECT [ResourceGuid], MAX( [_eventTime] ) AS [_eventTime] FROM
GROUP BY [ResourceGuid] ) et
GROUP BY et.[ResourceGuid]
) evt ON evt.[ResourceGuid] = a.[Guid]
WHERE a.[priority] = ( SELECT MAX( b.[priority] ) FROM #potentialTmpTable b WHERE a.[Guid] = b.[Guid] )
ORDER BY a.[Subnet] DESC, a.[priority] DESC, evt.[_eventTime] DESC
DROP TABLE #potentialTmpTable