feat: add GroundValueChecker and WeatherSensorDevice with public API integration

This commit introduces two new device types, GroundValueChecker and WeatherSensorDevice, which leverage public APIs (BORIS NRW and Open-Meteo) for real-time data collection. It also includes several API enhancements and fixes to support these new integrations.

Detailed changes:
- **New Device Types**:
  - Added GroundValueChecker schema and integration with BORIS NRW WMS via Zabbix Script items.
  - Added WeatherSensorDevice schema and integration with Open-Meteo via Zabbix HTTP Agent items.
- **API Enhancements**:
  - Added error field to ZabbixItem for item-level error reporting.
  - Updated CreateTemplateItem mutation input to support params (for Script items) and timeout.
  - Registered missing scalar resolvers: JSONObject, DateTime, and Time.
- **Performance & Reliability**:
  - Implemented batch fetching for item preprocessing in both host and template queries to reduce Zabbix API calls and ensure data visibility.
  - Updated template_importer.ts to correctly handle Script item parameters.
- **Documentation**:
  - Consolidated public API device recipes in docs/howtos/cookbook.md.
  - Added guidance on analyzing data update frequency and setting reasonable update intervals (e.g., 1h for weather, 1d for ground values).
- **Testing**:
  - Added new regression test REG-ITEM-META to verify item metadata (units, description, error, preprocessing) and JSONObject scalar support.
  - Enhanced RegressionTestExecutor with more detailed host-item relationship verification.
This commit is contained in:
Andreas Hilbig 2026-02-01 21:07:21 +01:00
parent 41e4c4da1f
commit ad104acde2
13 changed files with 378 additions and 45 deletions

View file

@ -191,12 +191,16 @@ export interface CreateTemplateItem {
master_item?: InputMaybe<CreateMasterItem>;
/** Name of the item. */
name: Scalars['String']['input'];
/** JavaScript code for Script items or other parameters. */
params?: InputMaybe<Scalars['String']['input']>;
/** Preprocessing steps for the item values. */
preprocessing?: InputMaybe<Array<CreateItemPreprocessing>>;
/** Zabbix item status (0 for Enabled, 1 for Disabled). */
status?: InputMaybe<Scalars['Int']['input']>;
/** Tags to assign to the item. */
tags?: InputMaybe<Array<CreateTag>>;
/** Timeout for item data collection. */
timeout?: InputMaybe<Scalars['String']['input']>;
/** Zabbix item type (e.g. 0 for Zabbix Agent, 18 for Dependent). */
type?: InputMaybe<Scalars['Int']['input']>;
/** Units of the value. */
@ -1108,6 +1112,8 @@ export interface ZabbixItem {
delay?: Maybe<Scalars['String']['output']>;
/** Description of the item. */
description?: Maybe<Scalars['String']['output']>;
/** Error message if the item is in an error state. */
error?: Maybe<Scalars['String']['output']>;
/** History storage period (e.g. '2d', '90d'). */
history?: Maybe<Scalars['String']['output']>;
/** Internal Zabbix ID of the host this item belongs to. */
@ -1743,6 +1749,7 @@ export type ZabbixItemResolvers<ContextType = any, ParentType extends ResolversP
attributeName?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
delay?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
error?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
history?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
hostid?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
hosts?: Resolver<Maybe<Array<ResolversTypes['Host']>>, ParentType, ContextType>;