Is it possible to execute the builtin commands on command line or via REST-API?
I’m thinking about the following commands:
cluster
icinga
cluster-zone
As it is today we have them added as normal icinga services but I would like to be able to have them executed “outside” the icinga2 daemon so to speak.
with most check commands you can execute them outside of Icinga, but not sure about the built-in ones for health.
Example for Freshness: '/usr/lib64/nagios/plugins/check_freshness.py' '-c' '100' '-H' 'db.local' '-d' 'icinga2' '-u' 'icingauser' '-p' 'some_password' '-w' '100' '-wp' '200%' '-cp' '400%'
I used the Director module to inspect the command executed on the check. However when I do the same for a built-in function, it’s just blank. The properties tell me that it’s built-in.
Unfortunately the answer is no. Only option you have is to trigger the next check via API if you need a fresher result using the reschedule-check action.
So an execute-check action which allowing the same would be a valid request but from discussions in the past executing checks somewhere in the cluster without a service definition would possibly allow running arbitrary code and expose a security risk, so an implementation is unlikely or if done has to be done carefully considering security. Only allowing them locally via CLI could be much simpler but is perhaps to limiting depending on the use case.