Page 1 of 1
Nagios XI Rest API
Posted: Fri Sep 29, 2017 5:57 am
by neosecurearg
Hi! We want to see all the Nagios audit from the last 7 days. As I'm seeing, the following command will show the last day:
$ curl -XGET '
https://127.0.0.1/nagiosxi/api/v1/objec ... y&pretty=1
How can I run it to see the last 7 days?
Thanks!
Re: Nagios XI Rest API
Posted: Fri Sep 29, 2017 9:11 am
by scottwilkerson
you need to add the following to the URL (from the docs)
starttime <timestamp> (Default: -24 hours) objects/statehistory?starttime=1506089409 - Displays the last week of data until now.
endttime <timestamp> (Default: now) objects/statehistory?starttime=1505484609&endtime=1506089409 - Displays 1 week of data starting 2 weeks ago. Should be used with starttime.
Re: Nagios XI Rest API
Posted: Sat Sep 30, 2017 11:01 am
by neosecurearg
Hi, thanks for your quick answer, one additional question: Is there any way to list all the audit entries through REST with logentry_data like '%NOTIFICATION%'?
Thanks in advance!
Re: Nagios XI Rest API
Posted: Sun Oct 01, 2017 11:24 am
by scottwilkerson
Yes, you can add the following to the URL
See the section at the top of the Help -> "Objects Reference" in XI for all available options, you can click on the
<type>: next to
<column> to see all the operators.
Re: Nagios XI Rest API
Posted: Mon Oct 02, 2017 4:44 am
by neosecurearg
Hi! Thanks for your time, we are not familiar yet with the help of Nagios XI, thanks for additionally show me where to find it.
Now we have found a new issue, we tought the /nagiosxi/api/v1/objects/logentries call includes the Audit Log, but it doesn't... is there any REST call to get the Nagios Audit Log (with the same events availables at Admin > Audit Log)?
Thanks in advance.-
Re: Nagios XI Rest API
Posted: Mon Oct 02, 2017 10:30 am
by scottwilkerson
This isn't available yet but will be added in the foture.
For the time being, you can pull a CSV version using the following URI structure
Code: Select all
/nagiosxi/admin/auditlog.php?reportperiod=custom&startdate=2017-10-01&enddate=2017-10-02&mode=getreport&mode=csv&apikey=YOUR_API_KEY