Access historial service data via REST API

Hello. Hoping someone can help with this.

I am currently accessing service details via REST API. I am wondering if I can query all the historical timestamps for when a service went critical. The services are simple PING services. I can see this historical information in the GUI as a graph.

I am using the endpoint: /domain-types/service/collections/all

I am using filter expressions to grab the exact services I want, and including the table columns I want included.

I could not find a column that stores this type of info. I suspect this data i’m seeing in the GUI is stored in rrd files not the db i’m querying with the api. Or is there a column I missed?

Or is there a way to build-a-custom-something-inside-checkmk to allow me to expose it to the outside?

Anyway, thanks for any help!

For historic events the Multisite views use a data source called “The Log”. This is currently not implemented in the REST API. But you can query it with the Multisite API (hint: output_format=json).

If you just add &output_format=json or csv to your GUI view you will get the results in a automation friendly format.

However if you have thousands of hosts spread across multiple sites this might not be the best way to solve your problem.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.