Curl for service status in host group

i need to make a curl via api to retrive only the status (ok, warning, critical) of all services in all hosts into a host group called cged.
I tried lot of time but without success.
Can i have an help?

  • Version used (version: 2.11.2-1)
  • Centos 7.9
  • Icinga Web 2 version 2.7.3
  • Enabled features: api checker command ido-mysql influxdb livestatus mainlog notification perfdata statusdata

please post what you tried…

thanks for reply
This command works but the result is too confuse and i need to receive only the status (ok, worn, crit)
curl -k -s -S -i -u davide:1234 ‘https://localhost:5665/v1/objects/services?service=inl-gedapp!ping4

this is the only commad that works…all other no

What do you want with a list of OKs, WARNINGs and CRITICALs without context returned form the API?
I would use the API call to get all the services objects of the hosts in the hostgroups and then in a second step filter the result to build a dictionary filled with the fields from the service objects in the form of host!servcie: state - in Python datatypes :wink:

I recommend using POSTs and use the advanced filter format: Icinga2 Api - Icinga 2 following the advice in the Tip box