- MSSQL 插件
- 概述
- Parameter details
- Plugins.MSSQL.CustomQueriesDir
- Plugins.MSSQL.CustomQueriesEnabled
- Plugins.MSSQL.Default.CACertPath
- Plugins.MSSQL.Default.Database
- Plugins.MSSQL.Default.Encrypt
- Plugins.MSSQL.Default.HostNameInCertificate
- Plugins.MSSQL.Default.Password
- Plugins.MSSQL.Default.TLSMinVersion
- Plugins.MSSQL.Default.TrustServerCertificate
- Plugins.MSSQL.Default.Uri
- Plugins.MSSQL.Default.User
- Plugins.MSSQL.KeepAlive
- Plugins.MSSQL.Sessions.<SessionName>.CACertPath
- Plugins.MSSQL.Sessions.<SessionName>.Database
- Plugins.MSSQL.Sessions.<SessionName>.Encrypt
- Plugins.MSSQL.Sessions.<SessionName>.HostNameInCertificate
- Plugins.MSSQL.Sessions.<SessionName>.Password
- Plugins.MSSQL.Sessions.<SessionName>.TLSMinVersion
- Plugins.MSSQL.Sessions.<SessionName>.TrustServerCertificate
- Plugins.MSSQL.Sessions.<SessionName>.Uri
- Plugins.MSSQL.Sessions.<SessionName>.User
- Plugins.MSSQL.System.Path
- Plugins.MSSQL.Timeout
- 选项
- 参数
MSSQL 插件
概述
配置参数可用于自定义 MSSQL 插件的行为。
建议将这些参数指定在它们自己的配置文件中(例如 mssql.conf),而不是写入 agent 2 配置文件。然后使用 Include 指令将此文件包含到 Zabbix agent 2 配置中。
MSSQL 插件是一个可加载插件,可在 MSSQL plugin repository 中获取并查看完整说明。
除非明确说明该参数为必填,否则所有参数均为可选。
请注意:
Parameter details
Plugins.MSSQL.CustomQueriesDir
Specify path to the directory containing user-defined .sql files with custom queries that the plugin can execute.
The plugin loads all available .sql files in the configured directory at startup.
This means that any changes to the custom query files will not be reflected until the plugin is restarted.
The plugin is started and stopped together with Zabbix agent 2.
Defaults:/usr/local/share/zabbix/custom-queries/mssql - for Unix systems,*:\Program Files\Zabbix Agent 2\Custom Queries\MSSQL - for Windows systems (where * is the drive name from the ProgramFiles environment variable)
Plugins.MSSQL.CustomQueriesEnabled
Enable execution of the mssql.custom.query item key.
If disabled, no queries will be loaded from the custom query directory path.
Default: false
Range: true/false
Plugins.MSSQL.Default.CACertPath
Specify the default file path to the public key certificate of the certificate authority (CA) that issued the certificate of the MSSQL server.
The certificate must be in PEM format.
Plugins.MSSQL.Default.Database
Specify the default database name.
Plugins.MSSQL.Default.Encrypt
Specify the level of default encryption.
Range:
true - data sending between plugin and server is encrypted;
false - data sending between plugin and server is not encrypted beyond the login packet;
strict - data sending between plugin and server is encrypted E2E using TDS8;
disable - data sending between plugin and server is not encrypted.
Plugins.MSSQL.Default.HostNameInCertificate
Specify the common name (CN) of the MSSQL server certificate by default.
Plugins.MSSQL.Default.Password
Specify the default password for a protected MSSQL server.
Plugins.MSSQL.Default.TLSMinVersion
Specify the minimum TLS version by default.
Range: 1.0, 1.1, 1.2, 1.3
Plugins.MSSQL.Default.TrustServerCertificate
Trust the server certificate without validating it by default.
Range: true, false
Plugins.MSSQL.Default.Uri
Specify the default URI for connecting to MSSQL server.
Embedded credentials will be ignored.
The only supported schema is sqlserver://.
The schema can be omitted.
Default: sqlserver://localhost:1433
Plugins.MSSQL.Default.User
Specify the default username for a protected MSSQL server.
Plugins.MSSQL.KeepAlive
Specify the maximum time of waiting (in seconds) before unused plugin connections are closed.
Default: 300
Range: 60-900
Plugins.MSSQL.Sessions.<SessionName>.CACertPath
Specify the named session file path to the public key certificate of the certificate authority (CA) that issued the certificate of the MSSQL server.
<SessionName> - define name of a session for using in item keys.
The certificate must be in PEM format.
Plugins.MSSQL.Sessions.<SessionName>.Database
Specify the named session database name.
<SessionName> - define name of a session for using in item keys.
Plugins.MSSQL.Sessions.<SessionName>.Encrypt
Specify the level of named session encryption.
<SessionName> - define name of a session for using in item keys.
Range:
true - data sending between plugin and server is encrypted;
false - data sending between plugin and server is not encrypted beyond the login packet;
strict - data sending between plugin and server is encrypted E2E using TDS8;
disable - data sending between plugin and server is not encrypted.
Plugins.MSSQL.Sessions.<SessionName>.HostNameInCertificate
Specify the common name (CN) of the MSSQL server certificate for named session.
<SessionName> - define name of a session for using in item keys.
Plugins.MSSQL.Sessions.<SessionName>.Password
Specify the named session password for a protected MSSQL server.
<SessionName> - define name of a session for using in item keys.
Plugins.MSSQL.Sessions.<SessionName>.TLSMinVersion
Specify the named session minimum TLS version.
<SessionName> - define name of a session for using in item keys.
Range: 1.0, 1.1, 1.2, 1.3
Plugins.MSSQL.Sessions.<SessionName>.TrustServerCertificate
Trust the named session server certificate without validating it.
<SessionName> - define name of a session for using in item keys.
Range: true, false
Plugins.MSSQL.Sessions.<SessionName>.Uri
Specify the named session URI for connecting to MSSQL server.
<SessionName> - define name of a session for using in item keys.
Embedded credentials will be ignored.
The only supported schema is sqlserver://.
The schema can be omitted.
Default: sqlserver://localhost:1433
Plugins.MSSQL.Sessions.<SessionName>.User
Specify the named session username for a protected MSSQL server.
<SessionName> - define name of a session for using in item keys.
Plugins.MSSQL.System.Path
Specify path to the MSSQL plugin executable.
Global setting for the MSSQL plugin. Applied to all connections.
Example: Plugins.MSSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-mssql
Plugins.MSSQL.Timeout
Set the duration, in seconds, to wait for a server to respond when first connecting and on follow-up operations in the session.
Default: default timeout
Range: 1-30
选项
| Parameter | Description |
|---|---|
| -V --version | 打印插件版本和许可信息。 |
| -h --help | 打印帮助信息(简写)。 |
| -t, --test <item key> | 启动插件进行测试(忽略插件配置)。 |
参数
| Parameter | Mandatory | Range | Default | Description |
|---|---|---|---|---|
| Plugins.MSSQL.CustomQueriesDir | no | /usr/local/share/zabbix/custom-queries/mssql for Unix systems*:\Program Files\Zabbix Agent 2\Custom Queries\MSSQL for Windows systems, where * is the drive name from the ProgramFiles environment variable |
指定包含用户自定义 .sql 文件的目录路径,这些文件中包含插件可执行的自定义查询。插件会在启动时加载配置目录中所有可用的 .sql 文件。这意味着,对自定义查询文件所做的任何更改都不会立即生效,直到插件重启后才会反映出来。插件与 Zabbix agent 2 一起启动和停止。 | |
| Plugins.MSSQL.CustomQueriesEnabled | no | false | 如果设置此参数,则启用 mssql.custom.query 监控项键的执行。若禁用,则不会从自定义查询目录路径加载任何查询。 |
|
| Plugins.MSSQL.Default.CACertPath | no | CA(证书颁发机构)签发 MSSQL 服务器证书的公钥证书默认文件路径。证书必须为 PEM 格式。 | ||
| Plugins.MSSQL.Default.Database | no | 要连接的默认数据库名称。 | ||
| Plugins.MSSQL.Default.Encrypt | no | 指定默认连接加密类型。可选值如下: true - 插件与服务器之间发送的数据会被加密; false - 插件与服务器之间发送的数据除登录数据包外不加密; strict - 插件与服务器之间发送的数据使用 TDS8 进行端到端加密; disable - 插件与服务器之间发送的数据不加密。 |
||
| Plugins.MSSQL.Default.HostNameInCertificate | no | MSSQL 服务器证书的通用名称(CN)。 | ||
| Plugins.MSSQL.Default.Password | no | 默认发送到受保护 MSSQL 服务器的密码。 | ||
| Plugins.MSSQL.Default.TLSMinVersion | no | 默认使用的最低 TLS 版本。可选值:1.0、1.1、1.2、1.3。 |
||
| Plugins.MSSQL.Default.TrustServerCertificate | no | 是否应默认信任服务器证书而不进行验证。可选值:true、false。 |
||
| Plugins.MSSQL.Default.Uri | no | sqlserver://localhost:1433 | 默认连接 URI。唯一支持的 schema 是 sqlserver://。可以省略 schema。嵌入的凭据将被忽略。 |
|
| Plugins.MSSQL.Default.User | no | 默认发送到受保护 MSSQL 服务器的用户名。 | ||
| Plugins.MSSQL.KeepAlive | no | 60-900 | 300 | 关闭未使用的插件连接前的最长等待时间(秒)。 |
| Plugins.MSSQL.Sessions.<SessionName>.CACertPath | no | 指定会话对应的 MSSQL 服务器证书的 CA(证书颁发机构)公钥证书文件路径。证书必须为 PEM 格式。 <SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.Database | no | 指定会话对应的要连接的数据库名称。 <SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.Encrypt | no | 指定会话对应的连接加密类型。可选值如下: true - 插件与服务器之间发送的数据会被加密; false - 插件与服务器之间发送的数据除登录数据包外不加密; strict - 插件与服务器之间发送的数据使用 TDS8 进行端到端加密; disable - 插件与服务器之间发送的数据不加密。 <SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.HostNameInCertificate | no | 指定会话对应的 MSSQL 服务器证书通用名称(CN)。 <SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.Password | no | 指定会话对应的发送到受保护 MSSQL 服务器的密码。 <SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.TLSMinVersion | no | 指定会话对应的最低 TLS 版本。可选值:1.0、1.1、1.2、1.3。<SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.TrustServerCertificate | no | 是否应为指定会话信任服务器证书而不进行验证。可选值:true、false。<SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.Sessions.<SessionName>.Uri | no | sqlserver://localhost:1433 | 指定会话对应的连接 URI。唯一支持的 schema 是 sqlserver://。可以省略 schema。嵌入的凭据将被忽略。<SessionName> - 定义一个会话名称,用于监控项键。 |
|
| Plugins.MSSQL.Sessions.<SessionName>.User | no | 指定会话对应的发送到受保护 MSSQL 服务器的用户名。 <SessionName> - 定义一个会话名称,用于监控项键。 |
||
| Plugins.MSSQL.System.Path | no | MSSQL 插件可执行文件的路径。 MSSQL 插件的全局设置。适用于所有连接。 示例用法: Plugins.MSSQL.System.Path=/usr/libexec/zabbix/zabbix-agent2-plugin-mssql |
||
| Plugins.MSSQL.Timeout | no | 1-30 | global timeout | 首次连接以及会话中的后续操作时,等待服务器响应的时长(秒)。 |
另请参见:
- Zabbix agent 2 一般配置参数说明:Zabbix agent 2 (UNIX) / Zabbix agent 2 (Windows)
- 配置 plugins 的说明