Icinga API data to PDF


I am new here, and I am creating reports in pdf with the data from Icinga.
I would like to ask how can I hold the data from Services but from different days.

because actual it gives me every time that update the current day.
Thank you

Hello and welcome Cristina :slightly_smiling_face:,

The Icinga2 API will only report the latest check result for host(s) or service(s) queried (as far as I know). So this will not cover the current day.

I’d recommend using the reporting module’s JSON output to retrieve an existing report’s data as JSON (depending of course on what data you need, the reporting module produces SLA reports).
Here’s an example if SLA data is of interest:

If you require actual events you should be able to query historical events as well with another endpoint (provided you are using IcingaDB):

You can select which filters to use by using Icingaweb2 to select the filters then copying the URL for JSON. The URL can be seen by right clicking on JSON in the History dropdown menu and copying the URL:

I hope this helps!

1 Like