Question on checkcommand in global-templates zone

Hi,
I follow this topic and I’m trying to implement check command on global templates .
However I have this error messsage :“Error: Function call ‘opendir’ for file ‘/etc/icinga2/zones.d/global-templates’ failed with error code 13, ‘Permission denied’” .
Which can be the issue?

Is that error coming on Icinga startup? what are the permissions for that folder?
ls -l /etc/icinga2/zones.d/global-templates

I don’t really get what you mean by that.
Do you have the check command definition?

For linux memory there already is a pre-defined check command mem inside the ITL. This works only locally, on the machine the plugin is executed.
There also is a pre-defined check command for snmp-mem, which needs the check_snmp_mem.pl added to the /usr/lib/nagios/plugins directory.

icinga2 daemon -C might also give you some hints/error messages.

When I execute the command icinga2 daemon -C the message that i described appears. In terms of permissions the golbal-templates folder are 766.

In the local machine (master) the plugins are executed without issues.
In the client i don’t get to execute custom checkcommands.

6 is r/w, you need execute in order to open a folder. If the owner of that directory is root and the Icinga daemon is running as the icinga user, it wont be able to open that folder. You probably want that set to 755 or 750 with Icinga as the owner if there’s sensitive information in it.

Reading your exchange with log1c, I think we might not be entirely aware of what you’re doing. My assumption was you were adding a service object to run that command. If it wasn’t just a permission issue, can we get start to finish what you’re attempting to do here so we don’t send you down weird rabbit holes?