Repository navigation
feat(monitoring): generated Zabbix templates with validation - #74
Merged
Merged
Conversation
Generate 'DeviceVault by HTTP' and 'DeviceVault Device by HTTP' from the metric catalogue for Zabbix 6.0 and 7.0 (monitoring/zabbix.py), commit them under deploy/zabbix/ with a drift test, serve them from /api/monitoring/zabbix/template/, and add manage.py zabbix_template and make zabbix-template. make zabbix-validate imports both into real Zabbix 6.0.49 and 7.0.32 containers (deploy/zabbix-test/), polls a stub serving recorded responses, and checks items, values and triggers; the zabbix.yml workflow runs it on monitoring changes. The Monitoring admin page gains template downloads, and DEPLOYMENT.md a Zabbix guide.
… queue behind a crawling server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Phase 24 (
docs/ARCHITECTURE.mdsection 7.7, "Zabbix templates", decision 51). Stacked on #73 → #72 → #71; merge those first.monitoring/zabbix.py), driven by the metric catalogue: items, discovery prototypes, units and value maps. Each version (6.0 and 7.0 LTS) has its own small emitter over shared content, with stable derived UUIDs.manage.py zabbix_template --version 6.0|7.0andmake zabbix-templatewritedeploy/zabbix/devicevault_zabbix_{6.0,7.0}.yaml, which are committed.GET /api/monitoring/zabbix/template/?version=serves the same file as a download (400 for an unknown version). The Monitoring admin page has download buttons for both versions.DeviceVault by HTTP, linked to one host:summary/,device-groups/,workers/,storage-targets/andreceivers/, plus an HTTP-status item for reachability.DeviceVault Device by HTTP, linked to existing device hosts:{$DV.RELAY.URL}/device/?ip={HOST.IP}&id={$DV.DEVICE.ID}every 15 minutes, with peer verification off for the relays' self-signed certificates;make zabbix-validateimports both templates into real Zabbix servers (alpine-6.0.49,alpine-7.0.32) and polls a stub serving recorded responses.zabbix.ymlworkflow on monitoring changes (not required, not part ofmake check).Deviations from the plan are recorded in ARCHITECTURE.md:
{$DV.URL}and{$DV.TOKEN}are left off the templates, so the global macros the guide asks for aren't shadowed.nodataperiod macros, becausenodata()can't take a multiple of a macro.device_response.How it was tested
make checkpasses, including the PostgreSQL run.make zabbix-validate, for each of 6.0.49 and 7.0.32:make dev-upstack: the template endpoint served both versions byte-identical to the committed files and returned 400 for an unknown version, and the Monitoring page loads.Checklist
make checkpasses locallyDV_*variables are documented indocs/DEPLOYMENT.mdand the relevant*.env.example(none new)makemigrations) (none)api/serializers.py,api/views.pyandfrontend/src/api/types.ts/endpoints.tsin stepREADME.md,docs/) updated where behaviour changed