Zabbix database schema¶
The Zabbix database schema is composed of numerous tables that store configuration, historical data, and relationships for the monitoring system. The structure relies heavily on identifiers like hostid and itemid to link related information across different tables^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Core Host and Group Tables¶
The hosts table is central to the schema, storing essential information for each device or agent, including the IP address, host ID (hostid), status, and IPMI details^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. Most other tables relate back to the hostid stored here^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. To organize these devices, the groups table stores group names and IDs^[600-developer-operation-maintenance-zabbix-zabbix-intro.md], while the hosts_groups table manages the many-to-many relationship between hosts and host groups^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Monitoring and Items Configuration¶
The actual monitoring Metrics are defined in the items table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. Key fields in this table include:
- itemid: The unique identifier for the item^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
- hostid: The identifier of the host associated with the item^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
- delay: The data collection interval^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
- history: The duration for which history data should be preserved^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
- status: The state of the item (e.g.,
0indicates a normal, displayed item)^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. - units: The unit of measurement for the item^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Visual representations of data are configured through the graphs table, which contains user-defined chart information^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. The specific items included in a graph are stored in the graphs_items table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Triggers and Logic¶
Zabbix uses triggers to evaluate conditions and define problems. The triggers table holds all information regarding these triggers^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. Logic within these triggers is often defined by expressions found in the functions table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. This table records the mathematical or logical functions (such as max, last, or nodata) used in trigger expressions^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. Dependencies between triggers are stored separately in the trigger_depends table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
When a trigger event occurs, Zabbix executes operations defined in the actions table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. A historical log of these alert events is maintained in the alerts table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Data Storage and Trends¶
The database schema separates raw historical data from aggregated trend data. Historical data is stored in various tables based on the data type, such as history (numeric), history_str, history_log, and history_uint_sync^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. These tables provide the data source for short-term graphs (e.g., 1 hour or 1 day)^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Long-term data is handled by the trends and trends_uint tables^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. These tables store trend statistics, such as the minimum, maximum, and average values, which are calculated from historical data at one-hour intervals^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. This aggregation allows for efficient graphing over longer time periods^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
System Configuration and Media¶
Global system parameters are stored in the config table^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. Alert delivery methods are configured through media (user-specific settings) and media_type (the execution scripts for specific alert types)^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
User-related data includes the profiles table for user settings^[600-developer-operation-maintenance-zabbix-zabbix-intro.md], the sessions table for active logins^[600-developer-operation-maintenance-zabbix-zabbix-intro.md], and the rights table, which records permissions for user groups^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]. Finally, the screeens table saves definitions for user-customized dashboard screens^[600-developer-operation-maintenance-zabbix-zabbix-intro.md].
Sources¶
^[600-developer-operation-maintenance-zabbix-zabbix-intro.md]