6 Monitor configuration: common part

Each file with the .conf extension in the monitor directory (/etc/databbix/dbs by default) defines a monitor. Files with any other extension are ignored, so to disable a monitor it is enough to rename its file (for example, to mydb.conf.off).

6.1 File structure#

A monitor file has two kinds of sections:

  • Common sections, the same for all engines: [General], [Zabbix], [Data] and [Log]. They are described in this chapter.

  • One engine section, with the connection data for the data source. Its name matches the engine chosen in General.Engine. It is described in each engine’s chapter.

Section Scope Contents
[General] common Host name, engine, query files, environment variables, retries and cache.
[Zabbix] common Zabbix server and passive port.
[Data] common Query modules and error tolerance.
[Log] common The monitor’s own log.
[Database] Database Driver, connection string and credentials (chapter 9).
[Webservice] Webservice Base URL, authentication and TLS (chapter 10).
[MQTT] MQTT Broker, credentials and subscription (chapter 11).

Skeleton of a monitor file:

# ---- Common sections ---------------------------------------------
[General]
Name = MYHOST
Engine = Database            # Database | Webservice | MQTT

[Zabbix]
Server = zabbix.example.com
Port = 10051

[Data]
Module = ...

[Log]
LogLevel = 4

# ---- Engine section (only one, the one for General.Engine) -------
[Database]
...

6.2 [General] section#

Parameter Default Description
Name mandatory Host name in Zabbix. It must match the host’s Host name field in Zabbix exactly.
Engine Database Engine: Database, Webservice or MQTT. Determines which connection section is read and which XML files are accepted.
QueryFile the global one XML query file(s). If present, it completely replaces the global list. Can be repeated.
Environment — Name=Value variables. They take precedence over those in databbix.conf and over the XML defaults. Can be repeated.
RetryOnError 60 Seconds between retries after a connection error with the source or with Zabbix.
MaxCache 10 Maximum lifetime in seconds of a cached result.

6.3 [Zabbix] section#

Parameter Default Description
Server mandatory DNS name or IP of the Zabbix server (or proxy).
Port mandatory Server port, usually 10051.
Refresh 300 Seconds between requests for the active item list.
MaxItemsPerPacket 100 Maximum number of values per send.
PassivePort 0 TCP port for passive checks. With 0 no port is opened. If used, it must be different for each monitor.

The passive port answers the items agent.ping, agent.version, agent.hostname and tez.ora.connstatus (1 if the connection to the source is up, 0 otherwise). For any other item it returns ZBX_NOTSUPPORTED. The passive port is used to check from Zabbix that the monitor is alive.

6.4 [Data] section#

Parameter Default Description
Module mandatory Query module used by this monitor (DB, Instance, PG, JDE…). Can be repeated.
MaxErrors 5 Maximum number of consecutive failed executions. When exceeded, the monitor stops. 0 disables the limit.
ConnLost OnDefault CtxError yes Database engine only: if switching to the default context fails, the connection is considered lost and re-established (section 9.5).

Note.  In old Database engine configurations, Module and MaxErrors appear in the [Database] section. That form is still valid, but if they exist in [Data], those in [Data] win.

6.5 [Log] section#

It accepts the same parameters as the [Log] section of databbix.conf (section 5.2.2). If not given, the global values are inherited. The default log file is <Name>.log, inside LogPath.

6.6 Special characters#

The # character starts a comment. If a value needs to contain # (for example, an Oracle multitenant common user or the wildcard of an MQTT subscription), write it as the sequence \043:

# User c##zabbix
UserName = c\043\043zabbix

Security.  Monitor files contain clear-text passwords. They must belong to root:databbix with permissions 0640, as the RPM installs them: the daemon can read them but not modify them. The databbix user must not be able to write to its own configuration (.conf files, query XML files or their directories), because the XML files may contain code that the daemon runs.