Getting Zabbix agent to execute a script

Started by Taomyn, February 19, 2021, 02:06:45 PM

Previous topic - Next topic


Is there specific permission I need to grant to my script and executable in order for the Zabbix agent to be able to execute them? Currently when it runs, it should output speed test results as an XML file which works if I run it manually, but from the Zabbix server I get this when it tries to execute it:

<speedtest>
test_output_1: Permission denied.
cat: test_output_1: No such file or directory

I know there's an outstanding issue to fix the deprecated "RemoteCommands" setting but is this now stopping the agent being able execute commands or is this just a permission thing? I know for Windows I have to add AllowKey=system.run[*] to the agent config file for similar scripts to work, but the config file on the firewall warns not to make any changes as I assume they will be lost if I reboot.

February 19, 2021, 06:12:00 PM #1 Last Edit: February 19, 2021, 06:13:46 PM by amichel
Hi,
in my case I initiate a shutdown in case internet is not available.
To do this I simply checked the "Enable Sudo root Pemissions" checkbox on the main settings of the Agent and Enable Remote Commands on the Zabbix Features Tab and then,run the command remotely through an action.

I "sudo" absolutely necessary if I am not performing any system level commands or access? The same script could be executes via SSH with an account I set up for PRTG that also did not have any special rights.