SLA Querying over the API

Hi,

In the IcingaDB documentation, a SLA reporting is mentioned:

Is there a way to query the Data over the API?

Background:

I am currently looking for a way to query the availability of Services that are in a Specific Service Group on a per-host basis.

E.g.

Host1 has 3 Services that are in the “sla” group. Each of the services fails for a Day, so i want to get the number 90% for this specific host. (30 days a month - 3x1d outage)

Is this possible with the information in that table?

All the best,

Nicolas

you can query your report via api
here is a python3 example

user = "admin"
pw = "****"
url = "https://example.com/icingaweb2/reporting/report/download?type=json&id=15"
page = requests.get(url, verify=False, headers={'Accept': 'application/json'}, auth=(user, pw))


I think this is referring to the reports module.

But that one is a bit Weird in its Reporting.

E.g. if i have a Server with 100 Services. And a single Service has been offline for the whole month, the SLA is 99%.

BUT, lets assume this is a webserver, and the service thats not available is nginx, then the “actual” uptime is 0.

So i would like to have some form of XOR for the Failing checks and want to get Time & SLA for when all Services were OK

The icingadb reporting functionality calculates individual per service sla and one combined sla in the end depending on your query/filter of the report

If you want to create dependecies or redundencies you need to put a check before your check.
this check would take care of a redudancy with or xor or whatever you need.
One way to implement that is creating a business process and create a check on your businessprocess.

The overall sla only makes sense if your filter is appropriate