目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。使用 InfluxDB,这个排名第一的时间序列平台旨在通过 Telegraf 进行扩展。
查看入门方法
输入和输出集成概述
VMware vSphere Telegraf 插件提供了一种从 VMware vCenter 服务器收集指标的方法,从而可以全面监控和管理 vSphere 环境中的虚拟资源。
此插件使用参数化的 SQL INSERT 语句将指标从 Telegraf 直接写入 MariaDB,从而提供了一种灵活的方式将指标存储在结构化的关系表中。
集成详情
VMware vSphere
此插件连接到 VMware vSphere 服务器以收集来自虚拟环境的各种指标,从而实现对虚拟资源的高效监控和管理。它与 vSphere API 接口,收集关于集群、主机、资源池、虚拟机、数据存储和 vSAN 实体的信息,并以适合分析和可视化的格式呈现。该插件对于管理基于 VMware 的基础设施的管理员尤其有价值,因为它有助于实时跟踪系统性能、资源使用情况和操作问题。通过聚合来自多个来源的数据,该插件使用户能够获得洞察力,从而促进关于资源分配、故障排除和确保最佳系统性能的知情决策。此外,对密钥存储集成的支持允许安全处理敏感凭据,从而促进安全和合规性评估方面的最佳实践。
MariaDB
Telegraf 中的 SQL 输出插件允许通过执行参数化的 SQL 语句将指标直接写入与 SQL 兼容的数据库(如 MariaDB)。凭借对 MySQL 驱动程序的支持,该插件与 MariaDB 无缝集成,以实现可靠的结构化指标存储。此设置非常适合喜欢基于 SQL 的分析或希望将指标与业务数据一起存储以进行统一查询的用户。MariaDB 是一个社区开发的、企业级的 MySQL 分支,它强调性能、安全性和开放性。该插件支持将时间序列指标插入到自定义模式中,从而可以使用 SQL 连接器灵活地进行分析以及与 Metabase 或 Grafana 等 BI 工具集成。
配置
VMware vSphere
[[inputs.vsphere]]
vcenters = [ "https://vcenter.local/sdk" ]
username = "[email protected]"
password = "secret"
vm_metric_include = [
"cpu.demand.average",
"cpu.idle.summation",
"cpu.latency.average",
"cpu.readiness.average",
"cpu.ready.summation",
"cpu.run.summation",
"cpu.usagemhz.average",
"cpu.used.summation",
"cpu.wait.summation",
"mem.active.average",
"mem.granted.average",
"mem.latency.average",
"mem.swapin.average",
"mem.swapinRate.average",
"mem.swapout.average",
"mem.swapoutRate.average",
"mem.usage.average",
"mem.vmmemctl.average",
"net.bytesRx.average",
"net.bytesTx.average",
"net.droppedRx.summation",
"net.droppedTx.summation",
"net.usage.average",
"power.power.average",
"virtualDisk.numberReadAveraged.average",
"virtualDisk.numberWriteAveraged.average",
"virtualDisk.read.average",
"virtualDisk.readOIO.latest",
"virtualDisk.throughput.usage.average",
"virtualDisk.totalReadLatency.average",
"virtualDisk.totalWriteLatency.average",
"virtualDisk.write.average",
"virtualDisk.writeOIO.latest",
"sys.uptime.latest",
]
host_metric_include = [
"cpu.coreUtilization.average",
"cpu.costop.summation",
"cpu.demand.average",
"cpu.idle.summation",
"cpu.latency.average",
"cpu.readiness.average",
"cpu.ready.summation",
"cpu.swapwait.summation",
"cpu.usage.average",
"cpu.usagemhz.average",
"cpu.used.summation",
"cpu.utilization.average",
"cpu.wait.summation",
"disk.deviceReadLatency.average",
"disk.deviceWriteLatency.average",
"disk.kernelReadLatency.average",
"disk.kernelWriteLatency.average",
"disk.numberReadAveraged.average",
"disk.numberWriteAveraged.average",
"disk.read.average",
"disk.totalReadLatency.average",
"disk.totalWriteLatency.average",
"disk.write.average",
"mem.active.average",
"mem.latency.average",
"mem.state.latest",
"mem.swapin.average",
"mem.swapinRate.average",
"mem.swapout.average",
"mem.swapoutRate.average",
"mem.totalCapacity.average",
"mem.usage.average",
"mem.vmmemctl.average",
"net.bytesRx.average",
"net.bytesTx.average",
"net.droppedRx.summation",
"net.droppedTx.summation",
"net.errorsRx.summation",
"net.errorsTx.summation",
"net.usage.average",
"power.power.average",
"storageAdapter.numberReadAveraged.average",
"storageAdapter.numberWriteAveraged.average",
"storageAdapter.read.average",
"storageAdapter.write.average",
"sys.uptime.latest",
]
datacenter_metric_include = [] ## if omitted or empty, all metrics are collected
datacenter_metric_exclude = [ "*" ] ## Datacenters are not collected by default.
vsan_metric_include = [] ## if omitted or empty, all metrics are collected
vsan_metric_exclude = [ "*" ] ## vSAN are not collected by default.
separator = "_"
max_query_objects = 256
max_query_metrics = 256
collect_concurrency = 1
discover_concurrency = 1
object_discovery_interval = "300s"
timeout = "60s"
use_int_samples = true
custom_attribute_include = []
custom_attribute_exclude = ["*"]
metric_lookback = 3
ssl_ca = "/path/to/cafile"
ssl_cert = "/path/to/certfile"
ssl_key = "/path/to/keyfile"
insecure_skip_verify = false
historical_interval = "5m"
disconnected_servers_behavior = "error"
use_system_proxy = true
http_proxy_url = ""
MariaDB
[[outputs.sql]]
## Database driver
## Valid options: mssql (Microsoft SQL Server), mysql (MySQL), pgx (Postgres),
## sqlite (SQLite3), snowflake (snowflake.com) clickhouse (ClickHouse)
driver = "mysql"
## Data source name
## The format of the data source name is different for each database driver.
## See the plugin readme for details.
data_source_name = "username:password@tcp(host:port)/dbname"
## Timestamp column name
timestamp_column = "timestamp"
## Table creation template
## Available template variables:
## {TABLE} - table name as a quoted identifier
## {TABLELITERAL} - table name as a quoted string literal
## {COLUMNS} - column definitions (list of quoted identifiers and types)
table_template = "CREATE TABLE {TABLE}({COLUMNS})"
## SQL INSERT statement with placeholders. Telegraf will substitute values at runtime.
## table_template = "INSERT INTO metrics (timestamp, name, value, tags) VALUES (?, ?, ?, ?)"
## Table existence check template
## Available template variables:
## {TABLE} - tablename as a quoted identifier
table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
## Initialization SQL
init_sql = "SET sql_mode='ANSI_QUOTES';"
## Maximum amount of time a connection may be idle. "0s" means connections are
## never closed due to idle time.
connection_max_idle_time = "0s"
## Maximum amount of time a connection may be reused. "0s" means connections
## are never closed due to age.
connection_max_lifetime = "0s"
## Maximum number of connections in the idle connection pool. 0 means unlimited.
connection_max_idle = 2
## Maximum number of open connections to the database. 0 means unlimited.
connection_max_open = 0
## NOTE: Due to the way TOML is parsed, tables must be at the END of the
## plugin definition, otherwise additional config options are read as part of the
## table
## Metric type to SQL type conversion
## The values on the left are the data types Telegraf has and the values on
## the right are the data types Telegraf will use when sending to a database.
##
## The database values used must be data types the destination database
## understands. It is up to the user to ensure that the selected data type is
## available in the database they are using. Refer to your database
## documentation for what data types are available and supported.
#[outputs.sql.convert]
# integer = "INT"
# real = "DOUBLE"
# text = "TEXT"
# timestamp = "TIMESTAMP"
# defaultvalue = "TEXT"
# unsigned = "UNSIGNED"
# bool = "BOOL"
# ## This setting controls the behavior of the unsigned value. By default the
# ## setting will take the integer value and append the unsigned value to it. The other
# ## option is "literal", which will use the actual value the user provides to
# ## the unsigned option. This is useful for a database like ClickHouse where
# ## the unsigned value should use a value like "uint64".
# # conversion_style = "unsigned_suffix"
输入和输出集成示例
VMware vSphere
-
动态资源分配:利用此插件监控虚拟机群的资源使用情况,并根据性能指标自动调整资源分配。这种情况可能涉及根据从 vSphere API 收集的 CPU 和内存使用率指标实时触发扩展操作,从而确保最佳性能和成本效益。
-
容量规划和预测:利用从 vSphere 收集的历史指标进行容量规划。分析 CPU、内存和存储使用率随时间变化的趋势,有助于管理员预测何时需要额外资源,避免中断并确保虚拟基础设施能够应对增长。
-
自动化警报和事件响应:将此插件与警报工具集成,以根据收集的指标设置自动通知。例如,如果主机上的 CPU 使用率超过指定阈值,则可能会触发警报并自动启动预定义的补救步骤,例如将虚拟机迁移到利用率较低的主机。
-
跨集群的性能基准测试:使用收集的指标比较不同 vCenter 中集群的性能。此基准测试提供了关于哪些集群配置产生最佳资源效率的见解,并可以指导未来的基础设施增强。
MariaDB
-
商业智能集成:将应用程序性能指标直接存储到 MariaDB 中,并将其连接到 Metabase 或 Apache Superset 等 BI 工具。此设置允许将运营数据与业务 KPI 混合,以实现统一的仪表板,从而增强跨部门的可见性。
-
具有历史指标的合规性报告:使用此插件将指标记录到 MariaDB 中,以用于审计和合规性用例。关系模型支持使用时间戳条目精确查询过去的性能指标,从而支持监管文档。
-
基于 SQL 逻辑的自定义警报:将指标插入 MariaDB,并使用自定义 SQL 查询来定义警报阈值或条件。与 cron 作业或计划脚本结合使用,这可以实现传统指标平台无法实现的高级警报工作流程。
-
物联网传感器指标存储:通过 Telegraf 收集来自物联网设备的传感器数据,并使用规范化模式将其存储在 MariaDB 中。这种方法具有成本效益,并且可以很好地与现有的基于 SQL 的系统集成,以进行实时或历史分析。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。使用 InfluxDB,这个排名第一的时间序列平台旨在通过 Telegraf 进行扩展。
查看入门方法