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.

Unusual Fields

Most of the fields in the list are self-explanatory, but we will document any unusual uses of fields here:

  • At present, there are none

Adding Data

  • Find the host_vars file for the host you want to update

  • Edit the zabbix_inventory list to add/update fields

  • Save and commit the change

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…​

Viewing the data

Go to Inventory in the Zabbix UI. The search tools work fine for looking at a single host, but are not super-great for looking at, e.g. all warranty dates across the infra.

TODO write some additional reporting tools for such usecases.