Ad Widget

Collapse

Question regarding python scripts used in Media Types

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MSkrzypczyk
    Junior Member
    • Mar 2020
    • 1

    #1

    Question regarding python scripts used in Media Types

    Fairly new to Zabbix and have been tasked with configuring an option to generate Jira tickets for any Problems raised in our environment with a High or above priority.
    I've located what should be a viable script for this and after some tweaking/testing, it appears it will run (from the command line at least!) without error when started from Python3 but not from Python(2.7) due to some pip module dependencies not being met. I had ensured the module was installed but still get an import error.
    As such I'm wondering if it's possible to get Zabbix to use Pyhton3 instead of Python to execute the "Script" media type when it's a .py file.
    I did see one suggestion previously for editing the shebang at top of script however that doesn't seem to have helped.
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Zabbix is pretty agnostic regarding the commands used for media types. You should be able to use just about any language you want for a program that's going to be a custom media type. As long as the user that your Zabbix server is running as can execute the script (and if the script has e.g. config file it reads with passwords or connection information in it for external services, then the config file must be readable by the Zabbix user your server runs as too), Zabbix really shouldn't care if it's python2 or python3.

    Remember that things like python 'virtualenv' are per-user, so if you did all your setup in a virtualenv, it has to be one that the Zabbix user has loaded and can access.

    Comment

    Working...