pschmitt / zabbix-template-speedtest

Speedtest template for zabbix
GNU General Public License v3.0
35 stars 21 forks source link

Ubuntu 20.04.1 LTS & Zabbix Unsupported item key and "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run." #13

Closed wojciehm closed 4 years ago

wojciehm commented 4 years ago

OS

Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

Prerequisites

Speedtest

speedtest-cli 2.1.2
Python 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0]

bc

bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.

jq

jq-1.6

Zabbix

etc/zabbix/zabbix_agentd.d# zabbix_server --version zabbix_server (Zabbix) 5.0.4

SSH script

SSH script is owned by zabbix:zabbix

I followed the Ubuntu instructions template is imported. When I manually try to execute test in zabbix_server.log I have following entries.

4297:20201002:104305.054 error reason for "zabbix.home:net.isp.speedtest" changed: Unsupported item key.
  4297:20201002:105145.606 error reason for "zabbix.home:speedtest.download" changed: Value of type "string" is not suitable for value type "Numeric (float)". Value "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run."
  4295:20201002:105515.958 item "zabbix.home:speedtest.download" became not supported: Value of type "string" is not suitable for value type "Numeric (float)". Value "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run."
  4296:20201002:105843.248 item "zabbix.home:speedtest.jitter" became not supported: Value of type "string" is not suitable for value type "Numeric (float)". Value "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run."
  4296:20201002:105844.255 item "zabbix.home:speedtest.ping" became not supported: Value of type "string" is not suitable for value type "Numeric (float)". Value "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run."
  4296:20201002:105846.267 item "zabbix.home:speedtest.timestamp" became not supported: Value of type "string" is not suitable for value type "Numeric (unsigned)". Value "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run."
  4297:20201002:105847.274 item "zabbix.home:speedtest.upload" became not supported: Value of type "string" is not suitable for value type "Numeric (float)". Value "Data is outdated. MAX_AGE is set to 3600 seconds. Please update with --run."

I guess it refers to this line https://github.com/pschmitt/zabbix-template-speedtest/blame/598a8274cbbed505a080e36c51968cc9ab733040/zbx-speedtest-debian.sh#L140

What could be an issue here?

Best regards Wojciech

pschmitt commented 4 years ago

It always bugged me that Zabbix agent treats stderr the same as stderr...

Is your cronjob setup correctly?

wojciehm commented 4 years ago

Hi. I didn't configure any schedule but based on the errors it runs every 5 minutes. The same happens when I try to execute it on demand. 2020-10-02 23_01_55-Zabbix Home_ History  refreshed every 30 sec

wojciehm commented 4 years ago

It might be that speedtest-cli removed some flags. When I try to run ./zbx-speedtest.sh --run I receive following error speedtest: error: unrecognized arguments: --accept-license --accept-gdpr -f json.

I tried to comment out lines 165 to 167 from https://github.com/pschmitt/zabbix-template-speedtest/blob/598a8274cbbed505a080e36c51968cc9ab733040/zbx-speedtest-debian.sh#L165 and script executes but /tmp/speedtest.json is empty.

As well when I try to execute zbx-speedtest.sh script as regular user nothing in /tmp is created.

pschmitt commented 4 years ago

Oh so you are not using the right speedtest-cli binary.

This plugin relies on Ookla'a version: https://www.speedtest.net/apps/cli

wojciehm commented 4 years ago

You are right. I installed speedtest from Ubuntu repository. There isn't repo for Ubuntu 20 so I had to install it manually. Now all works perfectly fine. image

Thanks for your help.