monigacom
(moniga)
1
Hi,
I’m trying to pull the services which are in “PENDING” (99) state. There are 200 services exist with that state in UI. I can’t pull them via api
I tried this but it result is empty.
curl -s -k -u user:pass -H ‘Accept: application/json’ -H ‘X-HTTP-Method-Override: GET’ -X POST -k “https://localhost:5665/v1/objects/services” -d ‘{ “filter”: “service.state==99” }’
I also want to query the list of hosts/services being checked by a Satellite/Checker using api.
Please advise.
Thanks
dnsmichi
(Michael Friedrich)
2
That state doesn’t exist in Icinga 2, that’s made up within Icinga Web 2.
In order to check for pending checks, the last_check_result
attribute must be null
in your filter.
Cheers,
Michael
1 Like
monigacom
(moniga)
3
Thank you Michael.
Any suggestion to get the list of hosts/services being checked by a Satellite/Checker using api ?
Thanks
dnsmichi
(Michael Friedrich)
4
Include the zone
attribute in your filter queries. You can find all available attributes inside the “Object types” chapter in the docs.
Another idea would be to programmatically fetch all objects and then inspect the key inside last_check_result called check_source
.