I have multiple team members adding devices to the NPM Is there any way to run a query or report showing devices and when they were added to the database?
Thanks,
rabalam
You can a report you can use the Last 250 Events OOB report as a template.
That information should be in the audit log. The audit log default life is 365 days (I think), but is adjustable in the web console. So things before that date won't be there.
You can get that from "Alerts & Activity > Message Center" and then search for Node Added.
Or you can build a report or use SWQL to get the data directly.
SELECT [Events].TimeLoggedUtc , [Events].AuditEventMessage , CONCAT('/Orion/NetPerfMon/NodeDetails.aspx?NetObject=', REPLACE([Events].NetObjectType, ' ', ''), [Events].NetObjectID) AS [DetailsUrl]FROM Orion.AuditingEvents AS [Events]WHERE [Events].AuditingActionType.ActionType = 'Orion.NodeAdded'ORDER BY TimeLoggedUtc DESC
I did some digging, and found (to my surprise) that the database does NOT, in fact, list the date the node was added. At least that I could find. I'm willing to be proven wrong by @KMSigma.SWI , @jblankjblank , @aLTeReGo or another member of the Orion database technorati).
Barring that, you could get there by creating a new custom property (called "createdDate" for instance), and then creating an alert trigger to populate it.
Working the alert backward, the trigger ACTION will be to fill in the "createdDate" field with the current date.
The Trigger logic itself would simply be nodes where the createdDate field is blank.
The result is that, when the node is added, the created Date will be blank. The alert trigger will pick that up after a minute, and fill in the field, after which it isn't blank and the alert will no longer re-trigger.
Once you have this in place, you can add that custom property to any of your existing reports.
Adatole, I like your idea as a way to use an alert to populate a custom property with the date the node was added. However, when setting up the alert trigger, I was confused as to which variable to use to extract the date timestamp. Using "DateTime" from the Nodes table just fills in today's date. It looks like you will need a custom SQL query to target the "Time Logged" variable from the Auditing Events table. Am I correct? How to do that?
One more thing in case it was not obvious from my earlier reply.... I would be looking to report on the date added for nodes ALREADY in the database - i.e the date the node was originally added to the database, assuming that information has not aged out of the database.
Yeah - that's there. Of course if it was added, then deleted, then added again, it'll show up twice.
What exact fields are you looking for? I might be able to whip up something quick.