5 Replies Latest reply on Feb 17, 2014 3:34 PM by KCWayner

    NPM Report for Nodes added in the past week.

    KCWayner

      I have been trying to figure out how to create a report to show what nodes have been added to NPM in the past week.  Has anyone done this before and if so, can they share their report?  Any help is appreciated.


      Wayne

        • Re: NPM Report for Nodes added in the past week.
          mgibson

          Search Thwack for " New nodes addded report"

          • Re: NPM Report for Nodes added in the past week.
            ET

            You can use [Events] as data source in your reports.

            report.png

             

             

             

            Or you can use audit events, but here you can use only Custom SQL as data source with this query.

             

            SELECT data.* FROM AuditingEvents data

            JOIN AuditingActionTypes types ON types.ActionTypeID = data.ActionTypeID

            WHERE types.ActionType='Orion.NodeAdded' AND data.TimeLoggedUtc > ${FromTimeUTC}

            • Re: NPM Report for Nodes added in the past week.
              KCWayner

              Here is what I have been able to use so far (it only gives what has been added that day) but I'm not sure how to make it a report for the last week.  I am by no means a DBA.

              select a.Caption, a.IP_Address, a.City, a.State, a.Priority, a.Primary_Contact,

                     from dbo.Nodes a, dbo.Events b

              where a.NodeID = b.NetObjectID and

                      datepart(year, b.EventTime ) = datepart(year, GetDate()) and

                      datepart(month, b.EventTime) = datepart(month, GetDate()) and

                      datepart(day, b.EventTime) = datepart(day, GetDate()) and

                      b.EventType = 9

                • Re: NPM Report for Nodes added in the past week.
                  KCWayner

                  ok.  after some digging I found a way to get the last 7 days but I don't know how it will work when it is the beginning of the month. here is what I have now.

                  where a.NodeID = b.NetObjectID and

                          datepart(year, b.EventTime ) = datepart(year, GetDate()) and

                          datepart(month, b.EventTime) = datepart(month, GetDate()) and

                          datepart(day, b.EventTime) >= datepart(day,DATEADD(day,-7,GetDate())) and

                          b.EventType = 9