Ad Widget

Collapse

When running a script from Zabbix GUI Zabbix returns "Unsupported key"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Djeggerr
    Junior Member
    • Aug 2023
    • 1

    #1

    When running a script from Zabbix GUI Zabbix returns "Unsupported key"

    Hi guys,

    So I've been trying to run a script I created on the Debian 12 machine hosting the Zabbix (ver 7.0.3) When using the test prompt in my Zabbix item I get "Unsupported key" returning, I am using the system. Run key. The script is named.sh and calls a python script which is in a venv.

    Here are the steps I followed to attempt a proper running of my script :
    1. I started by creating a venv to install my py module (mysql-connector)
    2. I then created my Python script which is running properly when using python3 When trying to run the script from Zabbix GUI it can't find the mysql-connector module without activating it with source activate (the py script runs every hour so i couldn't do it).
    3. Next step was creating test.sh in my venv to run the py script : source activate python3 /path/to/the/.py/script
    4. In /etc/zabbix/zabbix_agentd.conf I allowed the specific keys : AllowKey=system.run[/path/to/the/bash] --> systemctl daemon-reload
    5. In Zabbix GUI I write in the key line system.run[/path/to/the/bash]

    I have tried different ways of writing the system.run[/path/to/the/bash] but could not find a working key. Also, i've tried using UserParameters like this : UserParameter=Notifs[*], /path/to/the/bash

    Do you guys have any idea of what's wrong ? I am a beginner in Zabbix and I've tried looking into different workarounds but everything I've tried didn't work

    I am sorry for my poor English. Thanks in advance for your answers.
Working...