Skip to content

Migrating from py-zabbix to python-zabbix-utils - #1722

Merged
jertel merged 2 commits into
jertel:masterfrom
nsano-rururu:migrate_python-zabbix-utils
Nov 16, 2025
Merged

Migrating from py-zabbix to python-zabbix-utils#1722
jertel merged 2 commits into
jertel:masterfrom
nsano-rururu:migrate_python-zabbix-utils

Conversation

@nsano-rururu

@nsano-rururu nsano-rururu commented Nov 16, 2025

Copy link
Copy Markdown
Collaborator

Description

Since development of py-zabbix stopped in 2020, we switched to the official library python-zabbix-utils.

Checklist

  • I have reviewed the contributing guidelines.
  • I have included unit tests for my changes or additions.
  • I have successfully run make test-docker with my changes.
  • I have manually tested all relevant modes of the change in this PR.
  • I have updated the documentation.
  • I have updated the changelog.

Questions or Comments

Copilot AI review requested due to automatic review settings November 16, 2025 15:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the Zabbix alerter from the deprecated py-zabbix library to the modern zabbix-utils library (version 2.0.3+). The migration includes updating imports, class names, constructor parameters, and test expectations to align with the new library's API.

Key Changes:

  • Replace py-zabbix dependency with zabbix-utils>=2.0.3 in package configuration
  • Update Zabbix alerter implementation to use new API (Sender, ItemValue, parameter names)
  • Update test mocks and assertions to reflect the new library structure

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
setup.py Updated dependency from py-zabbix>=1.1.7 to zabbix-utils>=2.0.3
requirements.txt Updated dependency from py-zabbix>=1.1.7 to zabbix-utils>=2.0.3
elastalert/alerters/zabbix.py Migrated imports and class usage from pyzabbix (ZabbixSender, ZabbixMetric) to zabbix_utils (Sender, ItemValue); updated constructor parameter names (zabbix_server→server, zabbix_port→port)
tests/alerters/zabbix_test.py Updated test mocks from pyzabbix.ZabbixSender.send to zabbix_utils.Sender.send; added ns field to expected metrics to match ItemValue structure

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nsano-rururu
nsano-rururu requested a review from jertel November 16, 2025 15:57
@jertel
jertel merged commit 3137020 into jertel:master Nov 16, 2025
1 check passed
@nsano-rururu
nsano-rururu deleted the migrate_python-zabbix-utils branch November 17, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants