Ad Widget

Collapse

Error executing UserParameter speedtest-cli (Python)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thomas.christen
    Junior Member
    • May 2020
    • 1

    #1

    Error executing UserParameter speedtest-cli (Python)

    I'm running my Zabbix (latest version 4.4) on docker (Synology). Both server and agent are running on the same server. Downloaded the speedtest-cli from https://github.com/sivel/speedtest-cli


    1) created a folder on my NAS zabbix-agent/speedtest/bin

    wget -O speedtest-cli https://raw.githubusercontent.com/si...r/speedtest.py
    chmod +x speedtest-cli

    the file speedtest-cli starts with

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    # Copyright 2012 Matt Martz
    # All Rights Reserved.
    #
    ....
    ...
    ..

    2) created a folder on my NAS zabbix-agent/zabbix_agentd.d

    created a file:

    # speedtest-cli.conf
    #
    # UserParameter for speedtest-cli
    #
    # UserParameter=<key>,<shell command>
    UserParameter=speedtest-cli[*],/usr/speedtest/bin/speedtest-cli --server $1 --json

    3) added mounts to my zabbix-agent docker
    <my path>/zabbix-agent/speedtest and mount as /usr/speedtest
    <my path>/zabbix-agent/zabbix_agentd.d and mount as /etc/zabbix/zabbix_agentd.d

    4) enabled ZBX_ENABLEREMOTECOMMANDS by setting to 1

    5) started zabbix-agent

    6) added a new Host "WAN" and a new Item "speed" and key "speedtest-cli[6251]"
    Looks like all changes got loaded and the CLI tool is available too.

    Unfortunately I do not get the expected JSON. Response I get is: env: ‘python’: No such file or directory

    When I open a terminal in the container zabbix-agent and execute the script I get the same error.

    It seems that Python is not known or not accessible. Running the same script outside docker, it works fine. So Python would be on the Synology available.

    Any help appreciated.
    Last edited by thomas.christen; 04-05-2020, 20:38. Reason: Fixed a typo in the description. Correct path is "zabbix-agent/speedtest"
Working...