I have a LUA script that runs the following SQL:
SELECT max(Q.source) as source, isnull(min(DATEDIFF(SECOND, d.sampletime, getdate())-21600 + rn.tz_offset),99999999) as age, MIN(r.user_tag_1) as user_tag_1
FROM S_QOS_DATA Q
left JOIN S_QOS_SNAPSHOT D ON Q.table_id=D.table_id
left join CM_NIMBUS_ROBOT R ON q.source=r.robot
left join RN_QOS_DATA_0012 RN on q.table_id=rn.table_id and d.sampletime=rn.sampletime
where
q.qos='QOS_COMPUTER_UPTIME'
and ( r.is_hub=1 )
group by q.source order by age desc
I the create alarms based on the age.
And because this is actually being used to detect hubs (is_hub=1) that aren't reporting as a way to determine how long their tunnels have been down, I'm saving off the age in another table so that when the data for a hub ages out of QOS_COMPUTER_UPTIME I still know when it was last heard from.
-Garin