Skip to main content

Icinga2

icinga2 is an open-source host and network monitoring software, originally developed from the Nagios network monitoring application. Currently, icinga2 is released under the GNU GPL v2 license.

To store data collected by icinga2 into TDengine, simply modify the icinga2 configuration to point to the corresponding server and port of taosAdapter. This allows full utilization of TDengine's efficient storage and query performance for time-series data and cluster processing capabilities.

Prerequisites

The following preparations are needed to write icinga2 data into TDengine:

  • TDengine cluster is deployed and running normally
  • taosAdapter is installed and running normally. For details, please refer to taosAdapter user manual
  • icinga2 is installed. For icinga2 installation, please refer to official documentation

Configuration Steps

Configuring taosAdapter

Method to configure taosAdapter to receive icinga2 data:

  • Enable the configuration item in the taosAdapter configuration file (default location /etc/taos/taosadapter.toml)
...
[opentsdb_telnet]
enable = true
maxTCPConnections = 250
tcpKeepAlive = false
dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"]
ports = [6046, 6047, 6048, 6049]
user = "root"
password = "taosdata"
...

The default database name written by taosAdapter is icinga2, but you can also modify the dbs item in the taosAdapter configuration file to specify a different name. Fill in user and password with the actual TDengine configuration values. taosAdapter needs to be restarted after modifications.

  • You can also use taosAdapter command line parameters or set environment variables to enable taosAdapter to receive icinga2 data, for more details please refer to the taosAdapter reference manual

Configuring icinga2

  • Enable icinga2's opentsdb-writer (reference link https://icinga.com/docs/icinga-2/latest/doc/14-features/#opentsdb-writer)
  • Modify the configuration file /etc/icinga2/features-enabled/opentsdb.conf filling in <taosAdapter's host> with the domain name or IP address of the server running taosAdapter, <port for icinga2> with the corresponding port supported by taosAdapter for receiving icinga2 data (default is 6048)
object OpenTsdbWriter "opentsdb" {
host = "<taosAdapter's host>"
port = <port for icinga2>
}

Example file:

object OpenTsdbWriter "opentsdb" {
host = "127.0.0.1"
port = 6048
}

Verification Method

Restart taosAdapter:

sudo systemctl restart taosadapter

Restart icinga2:

sudo systemctl restart icinga2

After waiting about 10 seconds, use the TDengine CLI to query TDengine to verify if the corresponding database has been created and data has been written:

taos> show databases;
name |
=================================
information_schema |
performance_schema |
icinga2 |
Query OK, 3 row(s) in set (0.001867s)

taos> use icinga2;
Database changed.

taos> show stables;
name |
=================================
icinga.service.users.state_... |
icinga.service.users.acknow... |
icinga.service.procs.downti... |
icinga.service.users.users |
icinga.service.procs.procs_min |
icinga.service.users.users_min |
icinga.check.max_check_atte... |
icinga.service.procs.state_... |
icinga.service.procs.procs_... |
icinga.service.users.users_... |
icinga.check.latency |
icinga.service.procs.procs_... |
icinga.service.users.downti... |
icinga.service.users.users_... |
icinga.service.users.reachable |
icinga.service.procs.procs |
icinga.service.procs.acknow... |
icinga.service.procs.state |
icinga.service.procs.reachable |
icinga.check.current_attempt |
icinga.check.execution_time |
icinga.service.users.state |
Query OK, 22 row(s) in set (0.002317s)
note
  • The default subtable names generated by TDengine are unique ID values generated according to rules.