REST API - All Services for a Host

Hi all!

I just did my first steps with the rest API . But i still miss a call where i can get all the services of one specivic host. As example i found it here in the Documentation

https://docs.checkmk.com/latest/en/rest_api.html

Is there a call which delivers that ?


Because i do not really see it. Help would be nice.
Cheers Ch

Hi @mchoeti

it seems like the endpoint highlighted in yellow does exactly that.


The endpoint highlighted in orange can be filtered to a hostname, too.


You can find code examples in the API documentation you can access from within Checkmk
image

Or am I completely misunderstanding the question?

1 Like

Thank you i will give it a try. Yes you are right, silly me i was “unable” to check the right documentation.

But funny thing is, using the Endpoint with a wrong hostname gives ma an understandable anwer

{
    "title": "Not Found",
    "status": 404,
    "detail": "These fields have problems: host_name",
    "fields": {
        "host_name": [
            "Host not found: 'myhost'"
        ]
    }
}

But using the correct one , returns an error. Any ideas why?

<head>
    <title>500 Internal Server Error</title>
</head>

<body>
    <h1>Internal Server Error</h1>
    <p>The server encountered an internal error or
        misconfiguration and was unable to complete
        your request.</p>
    <p>Please contact the server administrator at
        nobody@localhost to inform them of the time this error occurred,
        and the actions you performed just before this error.</p>
    <p>More information about this error may be available
        in the server error log.</p>
</body>