feat: improve Zabbix version compatibility and optimize queries
This commit introduces several improvements to ensure the API works seamlessly across Zabbix 6.0, 6.4, and 7.0+, while also optimizing data fetching performance. Key changes: - Zabbix Version Compatibility: - Added Zabbix version detection and static caching in ZabbixAPI. - Implemented name-based fallback for host/template group permissions to support Zabbix 6.0 (which lacks UUIDs for host groups). - Added manual host group expansion for Zabbix versions < 6.2.0 during user group import. - Added version-based guards for history.push (7.0+) and hostgroup.propagate (6.2+). - Updated documentation with detailed version compatibility notes. - Added src/test/zabbix_6_0_compatibility.test.ts to verify compatibility logic. - Query Optimization: - Implemented dynamic output selection in ZabbixRequest to fetch only fields requested in GraphQL queries. - Added GraphqlParamsToNeededZabbixOutput to map GraphQL selections to Zabbix API output parameters. - Moved "Query Optimization" to achieved milestones in roadmap.md. - Other: - Updated various tests to support the new version-aware logic. - Optimized imports and synchronized IDE settings.
This commit is contained in:
parent
7c2dee2b6c
commit
ec6ed422b1
21 changed files with 363 additions and 100 deletions
17
README.md
17
README.md
|
|
@ -52,7 +52,7 @@ Before you begin, ensure you have met the following requirements:
|
|||
|
||||
- **Node.js**: Version 24 (LTS) or higher recommended.
|
||||
- **Docker**: Version 27 or higher and **Docker Compose** v2.29 or higher (use `docker compose` instead of `docker-compose`).
|
||||
- **Zabbix**: A running Zabbix instance (compatible with Zabbix 6.0+) with API access.
|
||||
- **Zabbix**: A running Zabbix instance (compatible with Zabbix 6.0+) with API access. See [Zabbix Version Compatibility](#-zabbix-version-compatibility) for details.
|
||||
- **Zabbix Super Admin Token** (for full functionality / privilege escalation).
|
||||
- **Zabbix User Access** (groups and roles depending on your use case).
|
||||
|
||||
|
|
@ -236,7 +236,20 @@ The API version is automatically set during the Docker build process based on th
|
|||
|
||||
### 🔧 Zabbix Version Compatibility
|
||||
|
||||
This API is designed to work with Zabbix 7.4, which is the version it runs productively with. While it may work with earlier versions (like 6.0+), 7.4 is the officially supported and tested version.
|
||||
This API is officially supported and productively used with **Zabbix 7.0 (LTS)** and newer. It also maintains compatibility with **Zabbix 6.0 (LTS)** and **6.4**, with the following version-specific behaviors:
|
||||
|
||||
- **Zabbix 7.0 (LTS)**:
|
||||
- Full feature support.
|
||||
- **History Push**: Uses the native `history.push` API for efficient data ingestion.
|
||||
- **Zabbix 6.4**:
|
||||
- **History Push**: Not supported (requires Zabbix 7.0+). The `pushHistory` mutation returns a clear error.
|
||||
- **Group Propagation**: Fully supported via the `hostgroup.propagate` API (introduced in 6.2).
|
||||
- **UUIDs**: Fully supported for both Host Groups and Template Groups.
|
||||
- **Zabbix 6.0 (LTS)**:
|
||||
- **History Push**: Not supported.
|
||||
- **Group Propagation**: `hostgroup.propagate` is unavailable. The API automatically performs **manual host group expansion** during import to ensure consistent behavior.
|
||||
- **UUIDs**: Host Groups in 6.0 lack UUIDs. The API uses a **name-based fallback** for matching host group permissions during import.
|
||||
- **Template Groups**: The API correctly handles the separation of Host Groups and Template Groups introduced in Zabbix 6.0 across all versions.
|
||||
|
||||
## 🛠️ Technical Maintenance
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue