Client Management Suite

 View Only
  • 1.  report workstation last reboot date?

    Posted Oct 06, 2010 02:09 PM

    Is there any way to view reboot history or last reboot date on a pc?

    I found a server report (sql):

    
    
    DECLARE @v1_TrusteeScope nvarchar(max)
    SET @v1_TrusteeScope = N'S-1-1-0,S-1-5-11,S-1-5-21-1430413068-4049567525-2713651233-4651,S-1-5-21-2366624401-2437885099-3855431815-1007,S-1-5-32-544'
    
    SELECT DISTINCT v.[Name] AS 'Computer Name',
    v.[Domain] AS 'Domain',
    t1.[Reboot Time] AS 'Reboot Date',
    v.[Guid] AS 'Guid'
    FROM dbo.vRebootHistory t1
    JOIN dbo.vComputer v
    ON t1.[_ResourceGuid] = v.[Guid]
    JOIN dbo.ScopeMembership sm
    ON sm.[ResourceGuid] = v.Guid
    AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
    WHERE UPPER(v.[Name]) LIKE UPPER('%')

    But dbo.vRebootHistory appears to empty.

    select *
    from dbo.vreboothistory

    So is there anyway to see this data on Workstations?



  • 2.  RE: report workstation last reboot date?

    Posted Oct 06, 2010 07:37 PM

    But if that view is empty, I'm guessing you're missing either a custom inventory, or monitoring, or metering data or something like that.  Have you tried reverse-engineering the View to see where it pulls data from?  I suspect from this post you know how to do that...



  • 3.  RE: report workstation last reboot date?

    Posted Oct 07, 2010 12:06 PM

    the view has a dependancy on this table:

    dbo.Inv_Reboot_History

    This table does not contain any data. 

    Here is the code of the view:

    USE [Symantec_CMDB]
    GO
    /****** Object: View [dbo].[vRebootHistory] Script Date: 10/07/2010 12:04:03 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER VIEW [dbo].[vRebootHistory]
    AS 
    SELECT Inv_Reboot_History._ResourceGuid [_ResourceGuid],
    Inv_Reboot_History.[Reboot Time] [Reboot Time]
    FROM dbo.Inv_Reboot_History

    Is this information not available from the basic Inventory Solution?  And only available if you have the Server Inventory add-in?



  • 4.  RE: report workstation last reboot date?

    Posted Oct 07, 2010 12:51 PM

    I'm checking around to see where it comes from.  Sorry I don't know yet.



  • 5.  RE: report workstation last reboot date?

    Posted Oct 08, 2010 10:27 AM

    Thanks I did find another report that I need to tear apart to see if I can get something from it I will keep this post updated.  The data has to be somewhere because this report tells me how many days of system up time.

      Reports 
     Discovery and Inventory 
     Inventory 
     Cross-platform 
     Operating System 
     Longest Uptime of 'N' Computers



  • 6.  RE: report workstation last reboot date?

    Posted Oct 11, 2010 01:34 PM

    Well this standard report actually does provide data but it is very deceptive.

    Here is the sql:

     DECLARE @sql NVARCHAR(MAX)
    DECLARE @Num NVARCHAR(MAX)
    IF '%Number%' = '' OR '%Number%' <= 0
    BEGIN
     SET @Num = '0'
    END
    ELSE
    BEGIN
     SET @Num = '%Number%'
    END
    SET @sql= 'DECLARE @v1_TrusteeScope nvarchar(max)
    SET @v1_TrusteeScope = N''%TrusteeScope%''
    SELECT TOP '+@Num+
     ' v.[Name] AS ''Computer Name'',
     v.[Domain] AS ''Domain'',
     t1.[Last Boot Up Time] AS ''Up Since'',
     v.[Guid] AS ''Guid''
    FROM
     dbo.vOSOperatingSystem t1
     JOIN dbo.vComputer v
      ON t1.[_ResourceGuid] = v.[Guid]
     JOIN dbo.ScopeMembership sm
      ON sm.[ResourceGuid] = v.Guid
      AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
    ORDER BY
     t1.[Last Boot Up Time] ASC'
    EXEC (@sql)
    

    This gives us a number of machines ordered by longest.  Using:

    dbo.vOSOperatingSystem.[Last Boot Up Time]

    The problem is what if a PC is shut down?  How does it determine it is no longer UP as the report suggest?  Not sure if when shutting down the agent does something to this field but I don't see anything.

    That makes this report soooooo horribly defined it is amazing it's in the list of standard reports.  Am I missing something!

    Let's put it this way.  The machine with the longest uptime does not even exist anymore!



  • 7.  RE: report workstation last reboot date?

    Posted Oct 11, 2010 02:16 PM

    If you really wanted to do this right, I'd use an inventory against the system logs to check on last boot time.  Or something like that.  Then you'd have a report you could filter based on YOUR rules.



  • 8.  RE: report workstation last reboot date?

    Posted Oct 11, 2010 02:57 PM

     I'd use an inventory against the system logs to check on last boot time.

    This would not be anymore efficient than what is already provided.  The problem is the report needs some way of checking to see if the PC is actually still up or has been shutdown.

    Either by a tickle

    or

    via an NSE that sends when the computer is shutting down ie Inv_Reboot_History as this would be something that a report could compare against.  This would not be perfect as someone could walk up to the PC and pull the plug preventing a NSE send.  This though would be reliable enough.