I’m getting this error when trying to use a custom command.
I created the command in zones.d/master/commands.conf and created a service in zones.d/master/services.conf.
The plugin/script is on both the master and the targeted host in the PluginDir and it has the correct rights to execute. The “does not exist” messages suggests that its not being picked up somehow?
Hi,
is there anything related in the log files (/var/log/icinga2/icinga2.log or /var/log/icinga2/error.log)?
Could you check grep PluginDir /etc/icinga2/constants.conf and crosscheck if check_zpools.sh is at the correct position?
Your check command does exist on your master but not at your agent (where it is needed). Putting any command objects in zones.d/master/commands.conf is the reason for this behavior. You could verify if your command object using icinga object list -n check_zpools at your master and at your agent.
Best practice is to place every command objects in a global zone that is defined at every agent and the master.
So even though I have it configured to push config from the master, I’ll have to manually create the command myself? Where should I be creating the command?
Global zones are configured in zones.conf. You then need to create a directory below zones.d with exact the same name and place every command objects in files within this directory. Details can be found here.