Can you use an "icingacli" command as a service?

I made one now with the director. I didn’t do it in the first place because I remembered that it wasn’t working with another command. But that’s another story.
The director command gives the same output.

If I am logged in to the nagios user I will get this output which is the same as viewed on the dashboard:

nagios@ism-icinga-01:~$ '/usr/bin/icingacli' 'vspheredb' 'check' 'host' '--name' 'vm.intern.somewhere.de'
PHP Fatal error:  Uncaught Error: Call to a member function translate() on null in /usr/share/php/Icinga/Application/functions.php:35
Stack trace:
#0 /usr/share/php/Icinga/Application/Config.php(328): t()
#1 /usr/share/php/Icinga/Application/Config.php(397): Icinga\Application\Config::fromIni()
#2 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(589): Icinga\Application\Config::app()
#3 /usr/share/php/Icinga/Application/Cli.php(42): Icinga\Application\ApplicationBootstrap->loadConfig()
#4 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(416): Icinga\Application\Cli->bootstrap()
#5 /usr/bin/icingacli(7): Icinga\Application\ApplicationBootstrap::start()
#6 {main}
  thrown in /usr/share/php/Icinga/Application/functions.php on line 35

Fatal error: Uncaught Error: Call to a member function translate() on null in /usr/share/php/Icinga/Application/functions.php:35
Stack trace:
#0 /usr/share/php/Icinga/Application/Config.php(328): t()
#1 /usr/share/php/Icinga/Application/Config.php(397): Icinga\Application\Config::fromIni()
#2 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(589): Icinga\Application\Config::app()
#3 /usr/share/php/Icinga/Application/Cli.php(42): Icinga\Application\ApplicationBootstrap->loadConfig()
#4 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(416): Icinga\Application\Cli->bootstrap()
#5 /usr/bin/icingacli(7): Icinga\Application\ApplicationBootstrap::start()
#6 {main}
  thrown in /usr/share/php/Icinga/Application/functions.php on line 35

ok. that looks to as if the nagios user has a different php setup compared to the root/system.
But to be honest I don’t really have an idea how to debug that, I’m not very experienced with php myself.

Or it could still be an underlying permissions problem.
What happens if you try reading/accessing the /etc/icingaweb2 folder and its sub folder as the nagios user?

Yeah I guess that too. I don’t know too much php myself either and would probably hand that to my colleagues. This will be my last day in this team btw so if you don’t hear from me anymore that’s due to that. I will give this thread to my colleagues, they may text you here. Thank you very much for your help so far! I learned a lot and it made a lot of other things easier to implement.

I can in fact read both directories:

nagios@ism-icinga-01:/etc/icingaweb2$ ls
authentication.ini  config.ini	enabledModules	groups.ini  modules  resources.ini  roles.ini
nagios@ism-icinga-01:/etc/icingaweb2$ cd enabledModules/
nagios@ism-icinga-01:/etc/icingaweb2/enabledModules$ ls
businessprocess  director  grafana  icingadb  incubator  ipl  monitoring  reactbundle  vspheredb
nagios@ism-icinga-01:/etc/icingaweb2/enabledModules$ 

Earlier I granted icinga rights to these directories.