-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Zabbix 7 compatibility, rewrite API code (#81)
* Add Zabbix 7.0 compatibility (#79) * Add Zabbix 7.0 compatibility * Add Host model comments * Add missing type annotations to __init__ .py * Fix state manager mypy issues * Refactor failsafe OK file checking, add test * Add type annotations to __init__ * Refactor process initialization * Refactor hanging process handling * Ignore missing mypy stubs in import * Extract failsafe functions, add tests * Fix zabbix_tags2zac_tags, add types * Fix StateManager mypy stub hack * Add type annotations for all processing.py methods * Improve state.State comments+docstrings * Refactor host modifier/source collector loading * Refactor failsafe checking Moves everything into failsafe.py module. This allows us to test the failsafe checking more thoroughly. * Fix incorrect variable usage * Refactor DB host retrieval in `ZabbixUpdater` * Fix broken tests * Add check_failsafe tests * Fix incorrect variable name * Rewrite API internals with Pydantic (#82) * Remove disabled hosts from maintenance * Add periodic maintenance cleanup * Add map_dir fixtures * Add config options * Fix mocks, use fixture * Rewrite API internals with Pydantic * Fix tests * Fix and improve JSON serialization * Fix changelog headers * Add API param building functions * Fix `set_hostgroups` not being able to remove groups * Add read-only mode for ZabbixAPI Activated during dryruns. * Fix `ParamsType` docstring * Document new config options in changelog * Update changelog * Add Py3.12 trove classifier * Update sample config * Fix ZabbixAPI method docstring tense * README: update supported versions * Create required host groups on startup * README: fix JSON example * README: Make host modifier example more relevant * Update changelog * Add notes on running source collectors standalone * Warn if no proxies * Remove redundant bool cast * Use absolute import * Use absolute imports * Sort host groups when logging new and old * Add note regarding Source Handler update interval * Change "replaced" to "updated" for source hosts * Remove trigger support in GC * Remove validation of request params * Add support for mysterious host.status==3 * Fix missing assignments in SignalHandler.__init__ * Fix missing parameter type annotation * Move warning next to statement that caused it * Add py.typed marker file * Update README, run GC every 24h * Show data in request errors * Fix fetching templates via old API code * Remove urllib3 logger, set logger on httpcore * Fetch groups when fetching hosts * Make bulk an optional field for CreateHostInterfaceDetails * Remove duplicated code for host interfaces * Refactor `set_interface` * Fix setting proxies on Zabbix 7 * Comments, var name * Update host group map when creating host group * Changelog heading * Fix README grammar * Log names of templates * Add NOTE comment * Add configurable group prefix separator
- Loading branch information
Showing
25 changed files
with
4,863 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- ## [Unreleased] --> | ||
|
||
## [0.2.0](https://github.com/unioslo/zabbix-auto-config/releases/tag/zac-v0.2.0) | ||
|
||
### Added | ||
|
||
- Zabbix 7 compatibility | ||
- Configuration option for setting group prefix separator. | ||
- `[zabbix]` | ||
- `prefix_separator`: Separator for group prefixes. Default is `-`. | ||
- Configuration options for each process. | ||
- `[zac.process.garbage_collector]` | ||
- `enabled`: Enable automatic garbage collection. | ||
- `delete_empty_maintenance`: Delete maintenances that only contain disabled hosts. | ||
- `update_interval`: Update interval in seconds. | ||
- `[zac.process.host_updater]` | ||
- `update_interval`: Update interval in seconds. | ||
- `[zac.process.hostgroup_updater]` | ||
- `update_interval`: Update interval in seconds. | ||
- `[zac.process.template_updater]` | ||
- `update_interval`: Update interval in seconds. | ||
- `[zac.process.source_merger]` | ||
- `update_interval`: Update interval in seconds. | ||
- Automatic garbage collection of maintenances (and more in the future.) | ||
- Removes disabled hosts from maintenances. | ||
- This feature is disabled by default, and must be opted into with `zac.process.garbage_collector.enabled` | ||
- Optionally also delete maintenances that only contain disabled hosts with `zac.process.garbage_collector.delete_empty_maintenance`. | ||
- If you have a large number of disabled hosts, it's recommended to set a long `update_interval` to avoid unnecessary load on the Zabbix server. The default is 300 seconds. | ||
- Automatic creation of required host groups. | ||
- Creates the groups configured by the following options: | ||
- `zabbix.hostgroup_all` | ||
- `zabbix.hostgroup_disabled` | ||
- Utility functions for serializing source collector outputs: | ||
- `zabbix_auto_config.models.hosts_to_json` | ||
- `zabbix_auto_config.models.print_hosts` | ||
- `py.typed` marker file. | ||
|
||
### Changed | ||
|
||
- API internals rewritten to use Pydantic models. | ||
- Borrows API code from Zabbix-cli v3. | ||
- Dry run mode now guarantees no changes are made to Zabbix by preventing all write operations via the API. | ||
|
||
### Deprecated | ||
|
||
- Zabbix 5 support. | ||
- Should in most cases work with Zabbix 5, but it will not be actively supported going forward. | ||
|
||
## 0.1.0 | ||
|
||
First version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.