Skip to content

Rewriting the script and making it for Zabbix 7.0 LTS - #226

Open
ableev wants to merge 2 commits into
masterfrom
updating-to-70lts
Open

Rewriting the script and making it for Zabbix 7.0 LTS#226
ableev wants to merge 2 commits into
masterfrom
updating-to-70lts

Conversation

@ableev

@ableev ableev commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Rewrite: split into modules, YAML config, Zabbix 7.0 support, tests

Modernizes the codebase after years of accumulated cruft.

  • Splits the single 941-line zbxtg.py into a zbxtg_lib/ package (cli, directives, config, telegram_api, zabbix_web, zabbix_api, maps, utils). zbxtg.py/zbxtg_group.py remain as thin entry points at the same path — no changes needed to existing AlertScriptsPath setups beyond copying the new zbxtg_lib/ folder alongside them.
  • Config moves to zbxtg_settings.yaml (see zbxtg_settings.example.yaml). Legacy zbxtg_settings.py is still auto-detected as a deprecated fallback.
  • Graph fetching still scrapes the Zabbix web frontend (chart3.php) — verified against current Zabbix source that the JSON-RPC API still can't render images as of 7.0. Dropped the legacy Zabbix 2.x period= URL param (current frontend only accepts from/to); now targets Zabbix 4.0+, primarily 7.0. Added optional zabbix_api.py with Bearer-token support (6.4+) for future use.
  • Fixed a latent bug: the location directive checked lat twice instead of lat and lon.
  • Adds a pytest suite (47 tests) covering directives, config loading, both API clients, and an end-to-end CLI smoke test.
  • README rewritten for the new layout, grammar cleaned up, screenshots unchanged.
  • requirements.txt: added PyYAML, bumped requests/PySocks, dropped unused requests-oauthlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant