Skip to content

Commit

Permalink
Replace pyzabbix with zabbix_utils
Browse files Browse the repository at this point in the history
pyzabbix is not tested on latest Zabbix LTS (7.0)
  • Loading branch information
fauust committed Nov 19, 2024
1 parent cc1cce8 commit e573214
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ RUN apt-get update \
libvirt-python \
mock \
mysqlclient \
pyzabbix \
sqlalchemy==1.3.23 \
treq \
twisted==22.10.0 \
zabbix_utils \
&& if [ "$master_type" = "master-web" ]; then \
pip install --no-cache-dir pyjade; \
fi \
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ libvirt-python
pylint
pylint-django
python-dotenv
pyzabbix
sqlalchemy==1.3.23
treq
zabbix_utils
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from datetime import datetime, timedelta

import docker
from pyzabbix import ZabbixAPI
from twisted.internet import defer
from zabbix_utils import ZabbixAPI

from buildbot.plugins import steps, util, worker
from buildbot.process.properties import Properties, Property
Expand Down Expand Up @@ -615,13 +615,13 @@ def prioritizeBuilders(buildmaster, builders):
##### Zabbix helper
def getMetric(hostname, metric):
# set API
zapi = ZabbixAPI(private_config["private"]["zabbix_server"])
zapi = ZabbixAPI(url=private_config["private"]["zabbix_server"])

zapi.session.verify = True

zapi.timeout = 10

zapi.login(api_token=private_config["private"]["zabbix_token"])
zapi.login(token=private_config["private"]["zabbix_token"])

host_id = None
for h in zapi.host.get(output="extend"):
Expand Down

0 comments on commit e573214

Please sign in to comment.