Using icingacli for monitoring after icingadb

I hope this is a dumb question. Recently we upgraded to Icinga 2.14. Further we migrated to icingdb and had to disable the old monitoring module (the Grafana integration stopped working, when it was enabled). In a few of our scripts we used the old module to get alerts states from services and hosts “icingacli monitoring…”. As the old module is gone, this does not work any more.

How can this be done after icingadb migration? Thanks!

the icingadb module has currently no cli capability.

You can use icinga2 api to get services and hoststates states

Another approach is to work with icinga objects directly using icinga’s DSL e.g. example1 or example2.

OK, thanks for the hint. Thats what we have in the past until we switched over to icingacli… I just had the hope there would be better solutions. Hilmar

Sorry, I don’t really see the relationship between your hints and my question. We used icingacli to get list of services, i.e. list all services with name “a” and status “b”. This list was used to run some scripts, which e.g. restarted icinga agents on remote hosts.

You could create a service that is running through icinga objects and handover services in question to an EventCommand.