cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Susan_A
Lansweeper Alumni
An asset's uptime since its last reboot is stored in seconds. Below are some report examples that convert the uptime to:
  • Days/hours/minutes
  • Days
  • Hours
  • Minutes

The reports below will only list assets that meet all of the following criteria:
  • The asset's state is set to "active".
  • The asset's uptime has been scanned and is visible in the Summary tab of the asset's Lansweeper webpage. Uptime information is scanned for Linux, Unix, Mac and Windows, VMware servers and SNMP enabled network devices.


Uptime in days/hours/minutes
Select Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 /
24))) + ' days ' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) / 3600 %
24))) + ' hours ' +
Convert(nvarchar(10),Ceiling(Floor(Convert(integer,tblAssets.Uptime) % 3600 /
60))) + ' minutes' As Uptime
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tblAssetCustom.State = 1 And tblAssets.Uptime Is Not Null
Order By tblAssets.Uptime Desc

Uptime in days
Select Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
Convert(Decimal(12,2),tblAssets.Uptime / 86400) As UptimeDays
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where Convert(Decimal(12,2),tblAssets.Uptime / 86400) Is Not Null And
tblAssetCustom.State = 1
Order By UptimeDays Desc

Uptime in hours
Select Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
Convert(Decimal(12,2),tblAssets.Uptime / 3600) As UptimeHours
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where Convert(Decimal(12,2),tblAssets.Uptime / 3600) Is Not Null And
tblAssetCustom.State = 1
Order By UptimeHours Desc

Uptime in minutes
Select Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename As AssetType,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
Convert(Decimal(12,2),tblAssets.Uptime / 60) As UptimeMinutes
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where Convert(Decimal(12,2),tblAssets.Uptime / 60) Is Not Null And
tblAssetCustom.State = 1
Order By UptimeMinutes Desc
8 REPLIES 8
mikethebake
Engaged Sweeper
Not sure if this possible, but is there a was to tell what time of the day these computers are on? Then pull a report for a certain time period. We are trying to figure what computers are still at night after we applied power saving settings.
Mike Baker wrote:
Not sure if this possible, but is there a was to tell what time of the day these computers are on? Then pull a report for a certain time period. We are trying to figure what computers are still at night after we applied power saving settings.

The reports in this topic are based on tblAssets.Uptime, which only stores the uptime since the last reboot. There are uptime events (reboots, shutdowns...) in tblUptime as well. You could build a report based on tblUptime that lists machines without a shutdown event in a given time period.
raleigh
Engaged Sweeper II
Susan.A wrote:
The reports in this topic are based on tblAssets.Uptime, which only stores the uptime since the last reboot. There are uptime events (reboots, shutdowns...) in tblUptime as well. You could build a report based on tblUptime that lists machines without a shutdown event in a given time period.


Hi there, I'm very new to Lansweeper and just exploring your reports and they are all great.

Would it be ok with you to make a report based on what you said above?

Also, I need to know the current logged in user as what I only see is the last logon user. can also have this report as well? Thank you so much in advance.

Respectfully,
Raleigh
laurentiun
Engaged Sweeper III
scanning once a day the computer status is not relevant. Use 6005 and 6006 eventid
laurentiun wrote:
scanning once a day the computer status is not relevant. Use 6005 and 6006 eventid

We received and answered a similar question from you via email, but for anyone else interested: Lansweeper does scan uptime events from the client machine's Event Viewer as well. This information is stored in the tblUptime database table.
sullivane
Champion Sweeper III
Thanks! I was trying to avoid looking at 15 different assets and doing math. Math is hard.
Daniel_B
Lansweeper Alumni
We scan power-on and power-off events from Windows computers, but generating a report on this which sums up the total uptime is not really possible with SQL. Windows computer asset pages have an uptime calendar which is calculated in the background from this data.
sullivane
Champion Sweeper III
Is there a report that will show total uptime for the last XX days?