配置 Grafana-Zabbix 插件
现在可以使用 Grafana 的配置系统通过配置文件配置数据源。您可以在 配置文档页面 上阅读更多关于其工作原理以及您可以为数据源设置的所有设置。
数据源配置文件示例
apiVersion: 1
datasources:
- name: Zabbix
type: alexanderzobnin-zabbix-datasource
url: https:///zabbix/api_jsonrpc.php
jsonData:
# Zabbix API credentials
username: zabbix
# Trends options
trends: true
trendsFrom: '7d'
trendsRange: '4d'
# Cache update interval
cacheTTL: '1h'
# Alerting options
alerting: true
addThresholds: false
alertingMinSeverity: 3
# Direct DB Connection options
dbConnectionEnable: true
# Name of existing datasource for Direct DB Connection
dbConnectionDatasourceName: MySQL Zabbix
# Retention policy name (InfluxDB only) for fetching long-term stored data.
# Leave it blank if only default retention policy used.
dbConnectionRetentionPolicy: one_year
# Disable acknowledges for read-only users
disableReadOnlyUsersAck: true
# Disable time series data alignment
disableDataAlignment: false
# Use value mapping from Zabbix
useZabbixValueMapping: true
secureJsonData:
password: zabbix
version: 1
editable: false
- name: MySQL Zabbix
type: mysql
url: localhost:3306
user: grafana
jsonData:
database: zabbix
secureJsonData:
password: password
- name: PostgreSQL Zabbix
type: grafana-postgresql-datasource
url: localhost:5432
user: grafana
jsonData:
database: zabbix
secureJsonData:
password: password
关于 MySQL / Postgres 在直接数据库连接模式下的详细配置说明,请参阅 MySQL 插件文档 / PostgreSQL 插件文档。