See www.zabbix.com for the official Zabbix site.

Docs/generating schema and data

From Zabbix.org
Jump to: navigation, search

Since 2.0, Zabbix uses a mechanism of auto-generated schema and data (previously only schema was auto-generated).

Schema template is in create/src/schema.tmpl, data template is create/src/data.tmpl.

Generating schema

To generate schema for a database, one must run:

 create/bin/gen_schema.pl <db>

Where db is one of ibm_db2, mysql, oracle, postgresql, sqlite3

Output is to stdout and should be redirected to a file, if needed.

Generating data

Steps to update data template

create db, insert schema, insert data, do modifications in frontend, export data. do not start zabbix server ! if server is needed for testing, take a dbdump, start server, test, restore dbdump and generate data.sql

Current (2012.07.12) data generation does skip unneeded tables and fields, but does not omit unneeded types of values - for example trigger prototypes would be exported, but so would be also LLD created triggers.

Template format details

in schema.sql ZBX_SYNC indicates data that is synchronised between nodes, ZBX_PROXY - data that is synchronised from server to proxy, and ZBX_NODATA - fields and tables that are not included in generated data.

ZBX_SYNC was dropped in Zabbix 2.4.0 along with node support in general.