文档文档

Icinga2 输入插件

此插件使用 Icinga2 远程 API 收集服务和主机状态信息。

引入于: Telegraf v1.8.0 标签: network, server, system 操作系统支持: all

全局配置选项

插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md

配置

# Gather Icinga2 status
[[inputs.icinga2]]
  ## Required Icinga2 server address
  # server = "https://:5665"

  ## Collected Icinga2 objects ("services", "hosts")
  ## Specify at least one object to collect from /v1/objects endpoint.
  # objects = ["services"]

  ## Collect metrics from /v1/status endpoint
  ## Choose from:
  ##     "ApiListener", "CIB", "IdoMysqlConnection", "IdoPgsqlConnection"
  # status = []

  ## Credentials for basic HTTP authentication
  # username = "admin"
  # password = "admin"

  ## Maximum time to receive response.
  # response_timeout = "5s"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = true

Metrics

  • icinga2_hosts
    • 标签 (tags)
      • check_command - 检查命令的短名称
      • display_name - 主机的名称
      • state - 状态: UP/DOWN
      • source - icinga2 主机
      • port - icinga2 端口
      • scheme - icinga2 协议 (http/https)
      • server - check_command 正在运行的服务器
    • 字段 (fields)
      • name (string)
      • state_code (int)
  • icinga2_services
    • 标签 (tags)
      • check_command - 检查命令的短名称
      • display_name - 服务的名称
      • state - 状态: OK/WARNING/CRITICAL/UNKNOWN (用于服务)
      • source - icinga2 主机
      • port - icinga2 端口
      • scheme - icinga2 协议 (http/https)
      • server - check_command 正在运行的服务器
    • 字段 (fields)
      • name (string)
      • state_code (int)
  • icinga2_status
    • component
      • ApiListener
        • 标签 (tags)
          • component 名称
        • 字段 (fields)
          • api_num_conn_endpoints
          • api_num_endpoint
          • api_num_http_clients
          • api_num_json_rpc_anonymous_clients
          • api_num_json_rpc_relay_queue_item_rate
          • api_num_json_rpc_relay_queue_items
          • api_num_json_rpc_sync_queue_item_rate
          • api_num_json_rpc_sync_queue_items
          • api_num_json_rpc_work_queue_item_rate
          • api_num_not_conn_endpoints
      • CIB
        • 标签 (tags)
          • component 名称
        • 字段 (fields)
          • active_host_checks
          • active_host_checks_15min
          • active_host_checks_1min
          • active_host_checks_5min
          • active_service_checks
          • active_service_checks_15min
          • active_service_checks_1min
          • active_service_checks_5min
          • avg_execution_time
          • avg_latency
          • current_concurrent_checks
          • current_pending_callbacks
          • max_execution_time
          • max_latency
          • min_execution_time
          • min_latency
          • num_hosts_acknowledged
          • num_hosts_down
          • num_hosts_flapping
          • num_hosts_handled
          • num_hosts_in_downtime
          • num_hosts_pending
          • num_hosts_problem
          • num_hosts_unreachable
          • num_hosts_up
          • num_services_acknowledged
          • num_services_critical
          • num_services_flapping
          • num_services_handled
          • num_services_in_downtime
          • num_services_ok
          • num_services_pending
          • num_services_problem
          • num_services_unknown
          • num_services_unreachable
          • num_services_warning
          • passive_host_checks
          • passive_host_checks_15min
          • passive_host_checks_1min
          • passive_host_checks_5min
          • passive_service_checks
          • passive_service_checks_15min
          • passive_service_checks_1min
          • passive_service_checks_5min
          • remote_check_queue
          • uptime
      • IdoMysqlConnection
        • 标签 (tags)
          • component 名称
        • 字段 (fields)
          • mysql_queries_1min
          • mysql_queries_5mins
          • mysql_queries_15mins
          • mysql_queries_rate
          • mysql_query_queue_item_rate
          • mysql_query_queue_items
      • IdoPgsqlConnection
        • 标签 (tags)
          • component 名称
        • 字段 (fields)
          • pgsql_queries_1min
          • pgsql_queries_5mins
          • pgsql_queries_15mins
          • pgsql_queries_rate
          • pgsql_query_queue_item_rate
          • pgsql_query_queue_items

示例查询

SELECT * FROM "icinga2_services" WHERE state_code = 0 AND time > now() - 24h // Service with OK status
SELECT * FROM "icinga2_services" WHERE state_code = 1 AND time > now() - 24h // Service with WARNING status
SELECT * FROM "icinga2_services" WHERE state_code = 2 AND time > now() - 24h // Service with CRITICAL status
SELECT * FROM "icinga2_services" WHERE state_code = 3 AND time > now() - 24h // Service with UNKNOWN status

示例输出

icinga2_hosts,display_name=router-fr.eqx.fr,check_command=hostalive-custom,host=test-vm,source=localhost,port=5665,scheme=https,state=ok name="router-fr.eqx.fr",state=0 1492021603000000000

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2