A modern GraphQL interface for Zabbix, providing enhanced features and easier integration for automation and management.
Find a file
Andreas Hilbig 023198d3fe docs: add README.md and LICENSE file
- Created README.md with project purpose, features, installation guide, and usage samples.

- Added LICENSE file with GNU Affero General Public License v3.0 to match Zabbix license.

- Added license field to package.json.
2026-01-26 19:05:50 +01:00
.forgejo/workflows chore: Update IntelliJ workspace and fix Docker image tag in workflow 2026-01-13 14:48:52 +01:00
.idea feat: add template and template group management via GraphQL 2026-01-24 15:42:13 +01:00
docs feat: add comprehensive tests and samples for host and user rights endpoints 2026-01-26 16:55:23 +01:00
schema feat: add template and template group management via GraphQL 2026-01-24 15:42:13 +01:00
src feat: add comprehensive tests and samples for host and user rights endpoints 2026-01-26 16:55:23 +01:00
.dockerignore Initial commit: Extract base Zabbix GraphQl - API functionality from VCR Project and add dynamic schema samples 2026-01-05 21:05:35 +01:00
.gitignore Initial commit: Extract base Zabbix GraphQl - API functionality from VCR Project and add dynamic schema samples 2026-01-05 21:05:35 +01:00
codegen.ts chore: Move schema directory away from src; Migrate extensions to schema directory, update Dockerfile and configuration paths 2026-01-14 10:03:38 +01:00
Dockerfile chore: Update Dockerfile CMD for schema path, log schema loading path in schema.ts, and adjust IntelliJ workspace 2026-01-14 14:21:14 +01:00
jest.config.js Initial commit: Extract base Zabbix GraphQl - API functionality from VCR Project and add dynamic schema samples 2026-01-05 21:05:35 +01:00
LICENSE docs: add README.md and LICENSE file 2026-01-26 19:05:50 +01:00
package-lock.json refactor!: Rename "devices" to "hosts" in "exportHistory" - operation. Prepare extraction of device specific types and alignment with integration layer 2026-01-06 12:42:43 +01:00
package.json docs: add README.md and LICENSE file 2026-01-26 19:05:50 +01:00
README.md docs: add README.md and LICENSE file 2026-01-26 19:05:50 +01:00
tsconfig.json Initial commit: Extract base Zabbix GraphQl - API functionality from VCR Project and add dynamic schema samples 2026-01-05 21:05:35 +01:00
zabbix-graphql-api.iml Initial commit: Extract base Zabbix GraphQl - API functionality from VCR Project and add dynamic schema samples 2026-01-05 21:05:35 +01:00

Zabbix GraphQL API

A modern GraphQL interface for Zabbix, providing enhanced features and easier integration for automation and management.

Purpose

The Zabbix GraphQL API acts as a wrapper and enhancer for the native Zabbix JSON-RPC API. It simplifies complex operations, provides a strongly-typed schema, and adds advanced logic for importing, querying, and managing Zabbix entities like hosts, templates, and user rights.

Key Features & Enhancements

Compared to the original Zabbix API, this GraphQL API provides several key enhancements:

  • Mass Import/Export: Robust support for importing and exporting templates, template groups, hosts, and host groups in bulk.
  • Hierarchical Host Groups: Automatically handles the creation and resolution of nested host group hierarchies (e.g., Parent/Child/Leaf).
  • Template Management:
    • Full support for template items, including complex preprocessing steps and tags.
    • Dependent Item Support: Intelligent deferred creation logic to handle item dependencies within a template.
    • Linked template resolution by name.
  • Advanced Deletion: Ability to delete templates and template groups not only by ID but also by name patterns (supporting Zabbix wildcards like %).
  • User Rights & Permissions:
    • Integrated management of user roles and user groups.
    • Support for importing/exporting user rights with UUID-based matching for cross-instance consistency.
    • On-the-fly permission checks (hasPermissions, userPermissions).
  • Improved Error Reporting: Detailed error data from Zabbix is appended to GraphQL error messages, making debugging significantly easier.
  • Strongly Typed Schema: Leverages GraphQL's type system for clear API documentation and client-side code generation.

How to Install and Start

Prerequisites

  • Node.js: Version 18 or higher recommended.
  • Zabbix: A running Zabbix instance (compatible with Zabbix 6.0+).

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd zabbix-graphql-api
    
  2. Install dependencies:

    npm install
    

Configuration

The API is configured via environment variables. Create a .env file or set them in your environment:

Variable Description Default
ZABBIX_BASE_URL URL to your Zabbix API (e.g., http://zabbix.example.com/zabbix)
ZABBIX_AUTH_TOKEN Zabbix Super Admin API token for administrative tasks
ZABBIX_EDGE_DEVICE_BASE_GROUP Base host group for devices Baustellen-Devices
SCHEMA_PATH Path to the directory containing .graphql schema files ./schema/

Starting the API

Development Mode

Starts the server with nodemon and tsx for automatic reloading:

npm run start

Production Mode

Builds the project and runs the compiled code:

npm run prod

The API will be available at http://localhost:4000/.

Usage Samples

The docs directory contains several sample GraphQL queries and mutations to help you get started:

License

This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.