Ad Widget

Collapse

Running automated scripts with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erezsandel
    Junior Member
    • Jan 2023
    • 4

    #1

    Running automated scripts with Zabbix

    Hello everyone.

    I am fairly new with Zabbix, and I am trying to configure a script to run whenever a certain trigger occurs.
    The way I did it was create an action that occurs whenever the trigger pops, and that action executes a simple script.
    What is the best practice for such a task? And also, what do I need to configure in my Zabbix agent/server to make this possible?
    Currently I am unable to make the script happen, even though I get no error in the Zabbix frontend, and the zabbix-agent2.log file doesn't provide me with any information, it just says that it executed the command, even though nothing happened.
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    If you want to run the script on the host that generated the trigger, the server (or proxy) must be able to communicate with the agent2 port. The agent2 config must include AllowKey per:

    "Make sure that the AllowKey=system.run[<command>,*] parameter is added for each allowed command in agent configuration to allow specific command with nowait mode. Restart agent daemon if changing this parameter."

    Note the *, remote commands specify nowait, without the *, they won't work

    test and check the logs for errors.

    Comment

    Working...