Page 1 of 1
Determining date that a node was added to Nagios XI
Posted: Mon Dec 17, 2018 11:22 am
by redacted
Is there a report that contains this or a table in the database that can be queried? Our billing team would like to automate a report of showing when the device was added and I am drawing a blank.
Thank you.
Re: Determining date that a node was added to Nagios XI
Posted: Mon Dec 17, 2018 2:56 pm
by bolson
Hello redacted,
In UNIX and Linux, there is no timestamp representing when a file is created. And in Nagios XI, the date and time that a config (node) was created is not stored in the database. Consequently, there is no way to script out determining when a node was added to the system. That said, if the host configuration file for a node goes unmodified after it's created, the mtime (last modified time) for the host config file could reliably represent the date/time the node was added. Hope this helps.
Re: Determining date that a node was added to Nagios XI
Posted: Mon Dec 17, 2018 4:21 pm
by mcapra
You could probably go through the historical Nagios logs and get a sense of when the very first "state" was registered for a particular node. That only goes as far back as your Nagios logs though, which are subject to some internal XI and Core retention settings.
Example:
Code: Select all
[root@capra_nag hosts]# grep -m 1 'ESMARVELPROD00' /usr/local/nagios/var/archives/*.log | head -1
/usr/local/nagios/var/archives/nagios-06-07-2017-00.log:[1495649213] EXTERNAL COMMAND: SCHEDULE_HOST_SVC_CHECKS;ESMARVELPROD00;1495649213
[root@capra_nag hosts]# grep -m 1 'PRODDATAMART' /usr/local/nagios/var/archives/*.log | head -1
/usr/local/nagios/var/archives/nagios-06-14-2017-00.log:[1497367847] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;PRODDATAMART;foo;1497367846
Re: Determining date that a node was added to Nagios XI
Posted: Mon Dec 17, 2018 5:49 pm
by npolovenko
@redacted, You could also add dates to new host in the Notes section. Host Management -> Notes. That's a guaranteed but manual approach and probably won't work if you're planning to add hundreds of hosts every day.
Re: Determining date that a node was added to Nagios XI
Posted: Wed Dec 19, 2018 11:11 am
by redacted
Thank you all very much for the replies.
At least I know I was not overlooking the date!
I will work around this most likely with the addition of a field that is populated when the devices are added to monitoring.
Re: Determining date that a node was added to Nagios XI
Posted: Wed Dec 19, 2018 2:34 pm
by bolson
May we go ahead and close this thread as resolved?