CLI commands with director for services and servicegroups

Hi!

This is my first post since I haven’t found any other topic/post about this. I want to use the icingacli on my host machine to list all services and servicegroups. I am using the commands to list hosts and hostgroups with “icingacli director hosts list” or “icingacli director hostgroups list” which works exactly as intended. However, the same command options are not listed to fetch the services or servicegroups.

Is there any workaround that can be used to get a list?

Thanks in advance!

It seems to be missing, unfortunately. However, i would use the Icinga2 REST API.

You can do a curl like this:

curl -s -k -u root:icinga 'https://localhost:5665/v1/objects/servicegroups' | jq .
4 Likes

I will try that, thank you!

Edit: Worked perfectly, thanks for the suggestion!

2 Likes