Perhaps something like:
Declare @sql as varchar(max)
Set @SQL = 'Select
''hello world''
as Message
'
--pseudo code for checking if site 1 or site 2 is down
IF Site 1 is down
Then exec (@SQL) at [LinkedServerForSite2]
else Then exec (@SQL) at [LinkedServerForSite1]