cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
NoZart
Engaged Sweeper II
we are using your programm lansweeper and I have a question regarding your programm.
Is it possible to check for computers were restart-times?
4 REPLIES 4
RCorbeil
Honored Sweeper II
The last restart can be derived using the uptime. As of tblAssets.Lastseen a machine had an uptime of tblAssets.Uptime seconds. To calculate the last restart time, subtract the uptime from the time last seen.
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
Convert(Decimal(6,2),tblAssets.Uptime / 60 / 60 / 24) As Uptime,
DateAdd(second, 0 - tblAssets.Uptime, tblAssets.Lastseen) AS LastBoot,
tblAssets.Lastseen,
tblAssets.Lasttried
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tblComputersystem ON tblAssets.AssetID = tblComputersystem.AssetID
WHERE
tblAssetCustom.State = 1
AND tblComputersystem.Domainrole < 2
ORDER BY
tblAssets.Uptime Desc
NoZart
Engaged Sweeper II
RC62N wrote:
The last restart can be derived using the uptime. As of tblAssets.Lastseen a machine had an uptime of tblAssets.Uptime seconds. To calculate the last restart time, subtract the uptime from the time last seen.
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
Convert(Decimal(6,2),tblAssets.Uptime / 60 / 60 / 24) As Uptime,
DateAdd(second, 0 - tblAssets.Uptime, tblAssets.Lastseen) AS LastBoot,
tblAssets.Lastseen,
tblAssets.Lasttried
FROM
tblAssets
INNER JOIN tblAssetCustom ON tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes ON tsysAssetTypes.AssetType = tblAssets.Assettype
INNER JOIN tblComputersystem ON tblAssets.AssetID = tblComputersystem.AssetID
WHERE
tblAssetCustom.State = 1
AND tblComputersystem.Domainrole < 2
ORDER BY
tblAssets.Uptime Desc


Thank you 🙂
i hope this is the right way and i'll check it on Monday..
uzetaab
Engaged Sweeper
you can see their uptime on their summary page. Will that do?
NoZart
Engaged Sweeper II
uzetaab wrote:
you can see their uptime on their summary page. Will that do?


The uptime is not the time of the last restart..or?