diff --git a/README.md b/README.md index 8214a5c..95671ac 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,35 @@ The GraphQL schema is located in the `schema/` directory and consists of: For comprehensive understanding of each operation, read the detailed comments in the respective schema files. +### Zabbix to GraphQL Mapping + +The API maps Zabbix entities to GraphQL types as follows: + +| Zabbix Entity | GraphQL Type | Description | +|---------------|--------------|-------------| +| Host | `Host` / `Device` | Represents a Zabbix host; `Device` is a specialized `Host` with a `deviceType` tag | +| Host Group | `HostGroup` | Represents a Zabbix host group | +| Template | `Template` | Represents a Zabbix template | +| Template Group | `HostGroup` | Represents a Zabbix template group | +| Item | Nested fields in `Device` | Zabbix items become nested fields in the device based on their key names | +| Tag | `Tag` | Represents a Zabbix tag associated with a host or template | +| Inventory | `Location` | Host inventory information maps to location data | + +### Zabbix Entity Relationships + +- **Host Groups**: Organize hosts and templates hierarchically; represented as `HostGroup` objects in GraphQL +- **Templates**: Contain items and other configuration that can be applied to hosts; linked via template groups +- **Items**: Individual metrics collected from hosts; automatically mapped to nested GraphQL fields based on their key names +- **Tags**: Metadata associated with hosts/templates; used for classification and filtering + +### Location Type Usage + +The `Location` type represents geographical information from Zabbix host inventory: + +- **Fields**: Includes `name`, `location_lat`, `location_lon`, and other inventory attributes +- **Usage**: Available through the `locations` query and as part of host/device objects +- **Access**: Retrieved via the `getLocations` method in the Zabbix API datasource + ### Dynamic Schema Extension Extend the schema without code changes using environment variables: @@ -383,6 +412,8 @@ The comments in these files contain real-world usage examples, implementation no ### Zabbix-Side Configuration Before extending the schema, you need to configure Zabbix appropriately: +#### 0. Template Group configuration +- Create a template group `Templates/Roadwork/Devices` #### 1. Host Configuration in Zabbix - Create a host in Zabbix with the tag `deviceType` set to `distance-tracker` diff --git a/readme.improvement.plan.md b/readme.improvement.plan.md index fb31dc0..783a3bd 100644 --- a/readme.improvement.plan.md +++ b/readme.improvement.plan.md @@ -1,42 +1,9 @@ -# README Improvement Plan - -## Priority 1: Critical Missing Information - -## Priority 2: Enhance Existing Sections - - - -## Priority 3: Add New Sections - ### 3.1 Code Generation Section - Explain the GraphQL Codegen setup and how to regenerate types - Document the `codegen.ts` configuration - Add instructions for updating generated types after schema changes -### 3.2 Troubleshooting Section -- Common connection issues with Zabbix server -- Authentication problems and solutions -- Schema extension troubleshooting -- Performance issues and optimizations - -### 3.3 Security Best Practices -- Recommended authentication approaches -- Permission system best practices -- Network security considerations -- API rate limiting and protection - -### 3.4 Performance and Scaling -- Performance considerations for large Zabbix installations -- Caching strategies -- Connection pooling recommendations -- Monitoring and observability setup - -### 3.5 Backup and Recovery -- Configuration backup procedures -- Schema migration guidelines -- Disaster recovery procedures - ## Priority 4: Improve Examples ### 4.1 Complete Examples