Tuesday, April 14, 2015

Server Up Time Report

Here is the report for server up time:

Select os.Caption0 as 'Operating System',
cs.Name0 as Name,
DateDiff(hour,os.LastBootUpTime0,ws.LastHWScan) as 'Uptime (in Hours)',
CONVERT(varchar(20),os.LastBootUpTime0,100) as 'Last Reboot Date/Time',
CONVERT(varchar(20),ws.LastHWScan,100) as 'Last Hardware Inventory'
From
dbo.v_GS_WORKSTATION_STATUS ws Left Outer Join dbo.v_GS_Operating_System os
on ws.ResourceID = os.ResourceID
inner join dbo.v_GS_COMPUTER_SYSTEM cs
on cs.ResourceID = os.ResourceID
WHERE os.Caption0 LIKE '%server%'
and ws.LastHWScan <> 0 and cs.Name0 is not null
Order by Cs.Name0


No comments:

Post a Comment