TDengine/docs/zh/14-reference/01-components/_icinga2.mdx
Xuefeng Tan 6f02ab7e4a
docs: add smlAutoCreateDB configuration for taosAdapter (#33343)
* docs: add smlAutoCreateDB configuration for taosAdapter in multiple documentation files

* docs: add description for smlAutoCreateDB configuration
2025-10-24 09:23:19 +08:00

46 lines
1.7 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#### 配置 taosAdapter
配置 taosAdapter 接收 icinga2 数据的方法:
- 在 taosAdapter 配置文件(默认位置 /etc/taos/taosadapter.toml中使能配置项
```toml
# 写入 Schemaless 数据时自动创建数据库
smlAutoCreateDB = true
[opentsdb_telnet]
enable = true
maxTCPConnections = 250
tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049]
user = "root"
password = "taosdata"
```
其中 taosAdapter 默认写入的数据库名称为 `icinga2`,也可以修改 taosAdapter 配置文件 dbs 项来指定不同的名称。user 和 password 填写实际 TDengine 配置的值。修改过 taosAdapter 需重新启动。
`smlAutoCreateDB` 配置项用于使能自动创建数据库功能,设置为 true 时taosAdapter 会在接收到数据时自动创建对应的数据库(如果不存在)。
- 使用 taosAdapter 命令行参数或设置环境变量启动的方式,使能 taosAdapter 接收 icinga2 数据功能,具体细节请参考 taosAdapter 的参考手册
#### 配置 icinga2
- 使能 icinga2 的 opentsdb-writer参考链接 https://icinga.com/docs/icinga-2/latest/doc/14-features/#opentsdb-writer
- 修改配置文件 `/etc/icinga2/features-enabled/opentsdb.conf` 填写 \<taosAdapter's host> 为运行 taosAdapter 的服务器的域名或 IP 地址,\<port for icinga2> 填写 taosAdapter 支持接收 icinga2 数据的相应端口(默认为 6048
```c
object OpenTsdbWriter "opentsdb" {
host = "<taosAdapter's host>"
port = <port for icinga2>
}
```
示例文件:
```c
object OpenTsdbWriter "opentsdb" {
host = "127.0.0.1"
port = 6048
}
```