cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PeterJG
Champion Sweeper II
Lansweeper tracks reboots.. can I create report that will show how many times and what time of the day PC was rebooted?

Any help where to start would be great.
1 ACCEPTED SOLUTION
David_G
Lansweeper Employee
Lansweeper Employee
Whenever a computer has booted, shutdown or went to sleep is stored in the database table tblUptime and is pulled from the computer's Event Viewer. You can use the report below to base yourself on which will provide you with the event type and when it occurred. Do note that this will report will have a lot rows, as a row is generated for each uptime event.

Instructions for adding this report to your Lansweeper installation can be found here. If you are interested in building or modifying reports, we do recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Making use of our database dictionary, which explains in great detail what each database table and field stores. More information on the dictionary can be found here.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
Case tblUptime.EventType When 1 Then 'Power on' When 2 Then 'Power off'
When 3 Then 'Start sleep' When 4 Then 'End sleep'
When 5 Then 'Unexpected shutdown' Else '' End As EventType,
tblUptime.EventTime
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblUptime On tblAssets.AssetID = tblUptime.AssetId
Order By tblAssets.AssetName

View solution in original post

2 REPLIES 2
PeterJG
Champion Sweeper II
Thanks.. this is awesome and great start.... I can customize this report to include more results and shape it the way I need.. getting the actual data fro these tables were the biggest challenge.. this helped allot.
David_G
Lansweeper Employee
Lansweeper Employee
Whenever a computer has booted, shutdown or went to sleep is stored in the database table tblUptime and is pulled from the computer's Event Viewer. You can use the report below to base yourself on which will provide you with the event type and when it occurred. Do note that this will report will have a lot rows, as a row is generated for each uptime event.

Instructions for adding this report to your Lansweeper installation can be found here. If you are interested in building or modifying reports, we do recommend:
  • Reviewing some SQL tutorials, as the Lansweeper report builder is a standard SQL editor. If you know SQL, you know how to build Lansweeper reports as well. This seems like a good tutorial.
  • Making use of our database dictionary, which explains in great detail what each database table and field stores. More information on the dictionary can be found here.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
Case tblUptime.EventType When 1 Then 'Power on' When 2 Then 'Power off'
When 3 Then 'Start sleep' When 4 Then 'End sleep'
When 5 Then 'Unexpected shutdown' Else '' End As EventType,
tblUptime.EventTime
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblUptime On tblAssets.AssetID = tblUptime.AssetId
Order By tblAssets.AssetName