unable to retrive the Host list in one host group

This forum was archived to /woltlab and is now in read-only mode.
  • Hi

    I am trying to retreive the host list in one host group, i have found the below query in icinga docs, but that is not working.


    curl -k -s -u root:XXXX https://localhost:5665/v1/objects/hosts?filter=TestGroup in host.groups | python -m json.tool

    {

    "error": 404.0,

    "status": "No objects found."

    }


    could some one help me with this API Query

  • https://www.icinga.com/docs/ic…2-icinga2-api/#parameters

    leads you to:

    curl -k -s -u root:XXXX 'https://localhost:5665/v1/objects/hosts?filter=%22TestGroup%22%20in%20host.groups'


    Or:


    curl -k -s -u root:XXXX -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/hosts' -d '{ "filter": "\"TestGroup\" in host.groups" }'


    So, decide if you like the funny characters or go with the beefy JSON object.