SOP Updating the Zabbix inventory
This SOP documents how we manage our hardware inventory via Zabbix and Ansible.
Contact Information
- Owner
-
Fedora Infrastructure Team
- Contact
-
#fedora-admin, sysadmin-main, sysadmin-noc
- Purpose
-
Ensure monitoring config is stored in configuration management for later (re)use.
Overview
We use a combination of Ansible host variables, and Zabbix inventory (populated via Ansible) to track things we know about our hosts. This covers things like serial numbers, warranty periods, contact details, rack locations, and so forth.
The Ansible repo is public, and Zabbix is easily reached via a FAS account. Do not put sensitive details in this system.
Ansible Data Source
The data is stored in the Ansible host variables (see [2] for an example),
under a list called zabbix_inventory. See [1] for the list of available keys
we can put into this list, and the values are strings.
Zabbix view of the data
Pushing data from Ansible to Zabbix
The inventory data is updated as part of the zabbix_agent role, so run the
playbook for the host with -t zabbix_agent. See [3] for the exact code.
TODO: updating non-agent hosts such as builders and OCP workers…
Resources
-
[1] Zabbix Inventory reference: https://www.zabbix.com/documentation/current/en/manual/api/reference/host/object#host-inventory
-
[2] Ansible host_vars: https://forge.fedoraproject.org/infra/ansible/src/branch/main/inventory/host_vars/vmhost-x86-copr01.rdu3.fedoraproject.org?display=source#L71-L77
-
[3] Ansible task: https://forge.fedoraproject.org/infra/ansible/src/branch/main/roles/zabbix/zabbix_agent/tasks/hosts.yml#L30
Want to help? Learn how to contribute to Fedora Docs ›