MQTT 插件

概述

配置参数可用于自定义 MQTT 插件的行为。

建议将这些参数指定在它们自己的配置文件中(例如 mqtt.conf),而不是放在 agent 2 配置文件中。然后使用 Include 指令将此文件包含到 Zabbix agent 2 配置中。

除非明确说明该参数为必填,否则所有参数均为可选

请注意:

  • 默认值反映的是进程默认值,而不是随软件提供的配置文件中的值;
  • 值支持环境变量
  • Zabbix 仅支持 UTF-8 编码且不含 BOM 的配置文件;
  • 以 "#" 开头的注释仅在行首支持。

Parameter details

Plugins.MQTT.Default.Password

Specify the default password for connecting to MQTT.
Used if no value is specified in an item key or named session.

Plugins.MQTT.Default.TLSCAFile

Specify full pathname of the file containing top-level CA(s) certificates for peer certificate verification for encrypted communications between Zabbix agent 2 and MQTT broker.
Used if no value is specified in a named session.

Plugins.MQTT.Default.TLSCertFile

Specify full pathname of the file containing the agent certificate or certificate chain for encrypted communications between Zabbix agent 2 and MQTT broker.
Used if no value is specified in a named session.

Plugins.MQTT.Default.TLSKeyFile

Specify full pathname of the file containing the MQTT private key for encrypted communications between Zabbix agent 2 and MQTT broker.
Used if no value is specified in a named session.

Plugins.MQTT.Default.Topic

Specify the default topic for MQTT subscription.
Used if no value is specified in an item key or named session.
The topic may contain wildcards ("+","#").

Examples:

path/to/file
path/to/#
path/+/topic
Plugins.MQTT.Default.Url

Specify the default MQTT broker connection string.
Used if no value is specified in an item key or named session.
Should not include query parameters.
Must match the URL format.
Supported schemes: tcp (default), ws, tls
A scheme can be omitted.
A port can be omitted (default=1883)

Default: tcp://localhost:1883

Examples:

tcp://host:1883
localhost
ws://host:8080
Plugins.MQTT.Default.User

Specify the default username for connecting to MQTT.
Used if no value is specified in an item key or named session.

Plugins.MQTT.Sessions.<SessionName>.Password

Specify the named session password for connecting to MQTT.
<SessionName> - define name of a session for using in item keys.

Plugins.MQTT.Sessions.<SessionName>.TLSCAFile

Specify full pathname of the file containing top-level CA(s) certificates for peer certificate verification for named session, used for encrypted communications between Zabbix agent 2 and MQTT broker.
<SessionName> - define name of a session for using in item keys.

Plugins.MQTT.Sessions.<SessionName>.TLSCertFile

Specify full pathname of the file containing the agent certificate or certificate chain for named session, used for encrypted communications between Zabbix agent 2 and MQTT broker.
<SessionName> - define name of a session for using in item keys.

Plugins.MQTT.Sessions.<SessionName>.TLSKeyFile

Specify full pathname of the file containing the MQTT private key for named session, used for encrypted communications between Zabbix agent 2 and MQTT broker.
<SessionName> - define name of a session for using in item keys.

Plugins.MQTT.Sessions.<SessionName>.Topic

Specify the named session topic for MQTT subscription.
<SessionName> - define name of a session for using in item keys.
The topic may contain wildcards ("+","#").

Examples:

path/to/file
path/to/#
path/+/topic
Plugins.MQTT.Sessions.<SessionName>.Url

Specify the named session MQTT broker connection string.
<SessionName> - define name of a session for using in item keys.
Should not include query parameters.
Must match the URL format.
Supported schemes: tcp (default), ws, tls
A scheme can be omitted.
A port can be omitted (default=1883)

Default: tcp://localhost:1883

Examples:

tcp://host:1883
localhost
ws://host:8080
Plugins.MQTT.Sessions.<SessionName>.User

Specify the named session username for connecting to MQTT.
<SessionName> - define name of a session for using in item keys.

参数

Parameter Mandatory Range Default Description
Plugins.MQTT.Default.Password no 连接到 MQTT 的默认密码;如果在监控项键值或命名会话中未指定任何值,则使用此密码。
Plugins.MQTT.Default.TLSCAFile no 包含用于对等证书验证的顶级 CA 证书的文件完整路径名,用于 Zabbix agent 2 与 MQTT broker 之间的加密通信;如果在命名会话中未指定任何值,则使用此文件。
Plugins.MQTT.Default.TLSCertFile no 包含 agent 证书或证书链的文件完整路径名,用于 Zabbix agent 2 与 MQTT broker 之间的加密通信;如果在命名会话中未指定任何值,则使用此文件。
Plugins.MQTT.Default.TLSKeyFile no 包含 MQTT 私钥的文件完整路径名,用于 Zabbix agent 2 与 MQTT broker 之间的加密通信;如果在命名会话中未指定任何值,则使用此文件。
Plugins.MQTT.Default.Topic no MQTT 订阅的默认主题;如果在监控项键值或命名会话中未指定任何值,则使用此主题。

主题可以包含通配符("+"、"#")
示例:path/to/file
path/to/#
path/+/topic
Plugins.MQTT.Default.Url no tcp://localhost:1883 默认 MQTT broker 连接字符串;如果在监控项键值或命名会话中未指定任何值,则使用此字符串。

不应包含查询参数。
必须符合 URL 格式。
支持的方案:tcp(默认)、wstls;方案可以省略。
端口可以省略(默认=1883)。
示例:tcp://host:1883
localhost
ws://host:8080
Plugins.MQTT.Default.User no 连接到 MQTT 的默认用户名;如果在监控项键值或命名会话中未指定任何值,则使用此用户名。
Plugins.MQTT.Sessions.<SessionName>.Password no 命名会话密码。
<SessionName> - 定义用于监控项键值中的会话名称。
Plugins.MQTT.Sessions.<SessionName>.TLSCAFile no 包含用于对等证书验证的顶级 CA 证书的文件完整路径名,用于 Zabbix agent 2 与 MQTT broker 之间的加密通信。
<SessionName> - 定义用于监控项键值中的会话名称。
Plugins.MQTT.Sessions.<SessionName>.TLSCertFile no 包含 agent 证书或证书链的文件完整路径名,用于 Zabbix agent 2 与 MQTT broker 之间的加密通信。
<SessionName> - 定义用于监控项键值中的会话名称。
Plugins.MQTT.Sessions.<SessionName>.TLSKeyFile no 包含 MQTT 私钥的文件完整路径名,用于 Zabbix agent 2 与 MQTT broker 之间的加密通信。
<SessionName> - 定义用于监控项键值中的会话名称。
Plugins.MQTT.Sessions.<SessionName>.Topic no 命名会话的 MQTT 订阅主题。
<SessionName> - 定义用于监控项键值中的会话名称。

主题可以包含通配符("+"、"#")
示例:path/to/file
path/to/#
path/+/topic
Plugins.MQTT.Sessions.<SessionName>.Url no 命名会话的连接字符串。
<SessionName> - 定义用于监控项键值中的会话名称。

不应包含查询参数。
必须符合 URL 格式。
支持的方案:tcp(默认)、wstls;方案可以省略。
端口可以省略(默认=1883)。
示例:tcp://host:1883
localhost
ws://host:8080
Plugins.MQTT.Sessions.<SessionName>.User no 命名会话用户名。
<SessionName> - 定义用于监控项键值中的会话名称。

如果需要设置请求执行超时(即在关闭请求之前等待其完成的时间),请使用监控项配置表单。

另请参见: