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.
Determining date that a node was added to Nagios XI
-
bolson
Re: Determining date that a node was added to Nagios XI
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.
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
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:
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
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Determining date that a node was added to Nagios XI
@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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Determining date that a node was added to Nagios XI
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.
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.
-
bolson
Re: Determining date that a node was added to Nagios XI
May we go ahead and close this thread as resolved?