→ Celebrate SysAdmin Day 2024 with Lansweeper Enter our Giveaway here

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
laurin1
Engaged Sweeper III
This might seem like a strange request, but is there a way to filter only machines that have a last seen date of less than X days ago (I know how to do this part), but also have been "online" for more than X days.

The issue is that we have machines that are offline most of the time, but come online periodically for very short periods (spare machines, for example), that we don't want to show up in a report.
3 REPLIES 3
ufficioced
Champion Sweeper
I would like to filter also machines that are currently online (i.e. respond to ping), do you know if there is some way to filter in this way?
thanks
laurin1
Engaged Sweeper III
I thought about using uptime, but concerned about accuracy. Our machines get restarted a lot - at least every Sunday (by an automated job). Still, that might work. I'll give that a shot.
MikeMc
Champion Sweeper II
Perhaps the Uptime column from the tblAssets table could be of use. The below sample lists assets that have been seen in the last 7 days and have a recorded uptime of 3 or more days.

Select Top 100000 tblAssets.AssetID, tblAssets.AssetName
From tblAssets
Inner Join tblAssetCustom on tblAssetCustom.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1 AND tblAssets.Lastseen >= DATEADD(day,-7, GETDATE())
And (tblAssets.Uptime / 86400) >= 3