3 Replies Latest reply on Jun 8, 2016 3:52 PM by RichardLetts

    NPM 11.5 - How long each interface or node was down

    datwiddler

      I found some old threads that talk about setting up a view or report to show a cumulative value of how long each node or interface has been down.

       

      Some of the images that show the steps are no longer there making it difficult to make this work.

       

      I'm really only looking to create a report of how long a node / interface has been down and then limit the report to anything greater than 24 hours.

       

      Has anyone done this is NPM 11.5? Is there a guide or steps?

        • Re: NPM 11.5 - How long each interface or node was down
          smartd

          Can you believe after 8 years, these GOB modules never made it into supported NPM? 

          • Re: NPM 11.5 - How long each interface or node was down
            mlandman

            Assuming you alert on node down...

            You can play with this as a custom SQL report:

            Select  Cast(_Bank_Name As nvarchar(250)) as _Bank_Name, caption

            ,  Cast(_Circuit_ID As nvarchar(250)) as _Circuit_ID

            , status, StatusDescription

            ,  Cast(Address As nvarchar(250)) as Address

            ,  Cast(City As nvarchar(250)) as City,  Cast(nodescustomproperties.State As nvarchar(250)) as State

            ,  Cast(ZipCode As nvarchar(250)) as ZipCode ,

            case

            when nd.Status = 9 then nd.UnManageFrom

            else  convert(smalldatetime,DATEADD(Hour,(DATEDIFF(HOUR, GETUTCDATE(), CURRENT_TIMESTAMP)),ao.LastTriggeredDateTime), 100)

            end

            as EventTime,

            case

            when nd.Status = 9 then DATEDIFF(Minute,nd.UnManageFrom,CURRENT_TIMESTAMP)

            else  DATEDIFF(MINUTE,ao.LastTriggeredDateTime,GETUTCDATE())

            end

            as 'Duration in Minutes'

            from nodescustomproperties

            left join AlertStatus a on a.ActiveObject = cast(nodescustomproperties.NodeID as varchar(150))

            left join NodesData nd on nd.NodeID = nodescustomproperties.NodeID

            left join AlertObjects ao on ao.RelatedNodeId = nodescustomproperties.NodeID

            where  nd.Status = 2

            AND (DATEDIFF(MINUTE,ao.LastTriggeredDateTime,GETUTCDATE()) > 100 or DATEDIFF(Minute,nd.UnManageFrom,CURRENT_TIMESTAMP) > 100

             

            This will output something like this:

             

            _Bank_Name     caption                     _Circuit_ID    status    StatusDescription      Address        City            State  ZipCode    EventTime                             Duration in Minutes

            Piggly Wiggly    Hostname.you.com    ABC-123      2           Node status is Down 123 Main St   Any Town   NY    10012         2016-06-08 09:22:00.000    358

              • Re: NPM 11.5 - How long each interface or node was down
                RichardLetts

                without alerting you can also do something like:

                SELECT
                  N.Caption
                  ,N.IP_address
                  ,NOD.DateTimeFrom
                  ,NOD.DateTimeUntil
                  ,DateDiff(minute,DateTimeFrom,DateTimeUntil) as minutes
                FROM NodesData N inner join [NetObjectDowntime] NOD on N.Nodeid=NOD.Nodeid
                where NOD.EntityType='Orion.Nodes' and NOD.state=2
                and N.Unmanaged=0
                and DateDiff(minute,DateTimeFrom,DateTimeUntil)>100