OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 21.1 Legacy Series »
  • Getting Zabbix agent to execute a script
« previous next »
  • Print
Pages: [1]

Author Topic: Getting Zabbix agent to execute a script  (Read 3651 times)

Taomyn

  • Sr. Member
  • ****
  • Posts: 444
  • Karma: 20
    • View Profile
Getting Zabbix agent to execute a script
« on: February 19, 2021, 02:06:45 pm »


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:
Code: [Select]
<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
Code: [Select]
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.
Logged

amichel

  • Jr. Member
  • **
  • Posts: 87
  • Karma: 8
    • View Profile
Re: Getting Zabbix agent to execute a script
« Reply #1 on: February 19, 2021, 06:12:00 pm »
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.
« Last Edit: February 19, 2021, 06:13:46 pm by amichel »
Logged

Taomyn

  • Sr. Member
  • ****
  • Posts: 444
  • Karma: 20
    • View Profile
Re: Getting Zabbix agent to execute a script
« Reply #2 on: February 22, 2021, 08:36:30 am »
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.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 21.1 Legacy Series »
  • Getting Zabbix agent to execute a script
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2