- **Optimization**: Implemented automatic Zabbix parameter optimization by analyzing GraphQL selection sets.
- **ZabbixRequest**: Added optimizeZabbixParams with support for skippable parameters and implied field dependencies (e.g., state -> items).
- **Resolvers**: Updated allHosts, allDevices, allHostGroups, and templates to pass requested fields to data sources.
- **Data Sources**: Optimized ZabbixQueryHostsGenericRequest and ZabbixQueryTemplatesRequest to skip unnecessary Zabbix API calls.
- **Regression Tests**: Enhanced RegressionTestExecutor with new tests for optimization (REG-OPT, REG-OPT-NEG), state retrieval (REG-STATE), dependent items (REG-DEP), and empty results (REG-EMPTY).
- **Documentation**: Created query_optimization.md How-To guide and updated roadmap.md, README.md, and tests.md.
- **Bug Fixes**: Fixed deviceType tag assignment during host import and corrected ZabbixCreateHostRequest to support tags.
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 introduces support for provisioning weather sensors with geo-coordinates
via user macros and fixes a critical mapping bug in device status.
Changes:
- fix: Corrected DeviceStatus enum mapping (0=ENABLED, 1=DISABLED).
- feat: Added 'status' field to CreateTemplateItem input in GraphQL schema.
- feat: Enabled user macro assignment during host and template creation/import.
- feat: Added regression tests for user macro assignment and HTTP agent URL support.
- docs: Updated cookbook and sample queries to use {$LAT} and {$LON} macros.
- test: Added unit tests for macro assignment in HostImporter and TemplateImporter.
- chore: Regenerated GraphQL types.
This change introduces the Weather Sensor device type which retrieves data from public APIs, and enhances the core Host/Device interfaces to provide consistent access to inventory and items across all specialized device types. It also improves search logic and fixes several bugs identified during implementation.
- Weather Sensor Extension: Added schema and recipe for a device retrieving weather data via Zabbix HTTP agent items.
- Interface Enhancements: Added inventory and items fields to Host and Device interfaces to ensure all device specialized types have consistent access to monitoring and inventory data.
- Search Logic Improvements: Enhanced ParsedArgs to support searchByAny and technical name (host) searches when a name pattern is provided.
- Bug Fixes:
- Fixed getLocations argument order in the Zabbix API datasource.
- Implemented deduplication for groupids and templateids in HostImporter to prevent Zabbix duplicate value errors.
- Added missing url field to CreateTemplateItem for HTTP Agent item support.
- Testing:
- Extended the regression test suite with 4 new automated checks covering the fixed bugs.
- Updated Jest tests to accommodate the improved search parameters.
- Documentation: Updated cookbook and test specifications to reflect new features and regression testing obligations.
- Add runSmoketest mutation to automate end-to-end verification.
- Add SmoketestExecutor and HostDeleter to support automated testing and cleanup.
- Extend createHost and importHosts to allow linking templates by name or ID.
- Update docs/howtos/cookbook.md with new recipe steps and AI/MCP guidance.
- Update .junie/guidelines.md with new verification and deployment standards.
- Add src/test/template_link.test.ts and update existing tests to cover new functionality.
- Regenerate GraphQL types to match schema updates.
- Added unit tests for schema loader, mocking Config variables and resolvers.
- Added unit tests for Zabbix API configuration, verifying constants derived from Config.
- Mocked relevant modules and filesystem behaviors to enable isolated testing.
- Optimized imports on all files and include this within a new .junie/guidelines.md file