目录
输入和输出集成概览
SNMP Trap Telegraf 插件能够接收 SNMP 通知,通过捕获来自网络设备的重要事件,促进全面的网络监控。
Graphite 插件使用户能够通过 TCP 将 Telegraf 收集的指标发送到 Graphite 中。此集成允许使用 Graphite 的强大功能有效地存储和可视化时序数据。
集成详情
SNMP Trap
SNMP Trap 插件充当 SNMP 通知(称为 trap 和 inform 请求)的接收端点。它通过 UDP 运行,监听传入的通知,这些通知可以配置为在特定端口上到达。此插件是网络监控和管理不可或缺的一部分,允许系统收集和响应从网络中各种设备(包括路由器、交换机和服务器)发送的 SNMP trap。该插件通过 SNMPv3 支持安全传输选项,从而能够使用身份验证和加密参数来保护敏感数据。此外,它还允许用户灵活地配置 SNMP 的多个方面(如 MIB 文件位置),使其能够适应各种环境和用例。建议从已弃用的 netsnmp 后端过渡到更新的 gosmi 后端,以利用其增强的功能和支持。实施此插件的用户可以有效地监控网络事件、自动响应 trap,并维护强大的网络监控基础设施。
Graphite
此插件通过原始 TCP 将指标写入 Graphite,从而将 Telegraf 收集的指标无缝集成到 Graphite 生态系统中。借助此插件,用户可以配置多个 TCP 端点以进行负载均衡,从而确保指标传输的高可用性和可靠性。使用前缀自定义指标命名以及利用各种模板选项的功能增强了数据在 Graphite 中表示方式的灵活性。此外,对 Graphite 标签的支持以及对严格清理指标名称的选项允许进行强大的数据管理,满足用户的各种需求。此功能对于希望利用 Graphite 强大的指标存储和可视化功能,同时保持对数据表示方式的控制的组织至关重要。
配置
SNMP Trap
[[inputs.snmp_trap]]
## Transport, local address, and port to listen on. Transport must
## be "udp://". Omit local address to listen on all interfaces.
## example: "udp://127.0.0.1:1234"
##
## Special permissions may be required to listen on a port less than
## 1024. See README.md for details
##
# service_address = "udp://:162"
##
## Path to mib files
## Used by the gosmi translator.
## To add paths when translating with netsnmp, use the MIBDIRS environment variable
# path = ["/usr/share/snmp/mibs"]
##
## Deprecated in 1.20.0; no longer running snmptranslate
## Timeout running snmptranslate command
# timeout = "5s"
## Snmp version; one of "1", "2c" or "3".
# version = "2c"
## SNMPv3 authentication and encryption options.
##
## Security Name.
# sec_name = "myuser"
## Authentication protocol; one of "MD5", "SHA", "SHA224", "SHA256", "SHA384", "SHA512" or "".
# auth_protocol = "MD5"
## Authentication password.
# auth_password = "pass"
## Security Level; one of "noAuthNoPriv", "authNoPriv", or "authPriv".
# sec_level = "authNoPriv"
## Privacy protocol used for encrypted messages; one of "DES", "AES", "AES192", "AES192C", "AES256", "AES256C" or "".
# priv_protocol = ""
## Privacy password used for encrypted messages.
# priv_password = ""
Graphite
# Configuration for Graphite server to send metrics to
[[outputs.graphite]]
## TCP endpoint for your graphite instance.
## If multiple endpoints are configured, the output will be load balanced.
## Only one of the endpoints will be written to with each iteration.
servers = ["localhost:2003"]
## Local address to bind when connecting to the server
## If empty or not set, the local address is automatically chosen.
# local_address = ""
## Prefix metrics name
prefix = ""
## Graphite output template
## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
template = "host.tags.measurement.field"
## Strict sanitization regex
## This is the default sanitization regex that is used on data passed to the
## graphite serializer. Users can add additional characters here if required.
## Be aware that the characters, '/' '@' '*' are always replaced with '_',
## '..' is replaced with '.', and '\' is removed even if added to the
## following regex.
# graphite_strict_sanitize_regex = '[^a-zA-Z0-9-:._=\p{L}]'
## Enable Graphite tags support
# graphite_tag_support = false
## Applied sanitization mode when graphite tag support is enabled.
## * strict - uses the regex specified above
## * compatible - allows for greater number of characters
# graphite_tag_sanitize_mode = "strict"
## Character for separating metric name and field for Graphite tags
# graphite_separator = "."
## Graphite templates patterns
## 1. Template for cpu
## 2. Template for disk*
## 3. Default template
# templates = [
# "cpu tags.measurement.host.field",
# "disk* measurement.field",
# "host.measurement.tags.field"
#]
## timeout in seconds for the write connection to graphite
# timeout = "2s"
## 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 = false
输入和输出集成示例
SNMP Trap
-
集中式网络监控:将 SNMP Trap 插件集成到集中式监控解决方案中,以实时接收有关网络设备的警报。通过配置插件以监听来自各种路由器和交换机的 trap,网络管理员可以快速响应问题,例如设备中断或超出关键阈值。此设置能够实现主动管理和快速解决网络问题,从而最大限度地减少停机时间。
-
自动化事件响应:每当收到特定 trap 时,使用 SNMP Trap 插件触发自动化事件响应工作流程。例如,如果检测到指示硬件故障的 trap,则可以启动自动化脚本来收集诊断信息、通知支持人员,甚至尝试修复操作。这种方法通过减少人工干预和加快响应时间来提高 IT 运营的效率。
-
网络性能分析:部署 SNMP Trap 插件以收集性能指标以及 trap,从而全面了解网络运行状况。通过将此数据聚合到分析平台中,网络团队可以分析趋势、识别瓶颈并根据历史数据优化性能。这使得能够围绕网络升级或变更做出明智的决策和战略规划。
-
与警报系统集成:将 SNMP Trap 插件连接到 PagerDuty 或 Slack 等第三方警报系统。收到预定义的 trap 后,插件可以将警报发送到这些系统,使团队能够立即收到重要网络事件的通知。此集成确保在正确的时间通知正确的人员,从而帮助保持高服务水平和快速解决问题。
Graphite
-
动态指标可视化:Graphite 插件可用于将来自各种来源的实时指标(例如应用程序性能数据或服务器运行状况指标)馈送到 Graphite 中。这种动态集成允许团队创建交互式仪表板,可视化关键绩效指标、跟踪随时间变化的趋势,并做出数据驱动的决策以提高系统性能。
-
负载均衡指标收集:通过在插件中配置多个 TCP 端点,组织可以为指标传输实施负载均衡。此用例确保指标交付既有弹性又有效,从而降低高流量期间数据丢失的风险,并保持信息到 Graphite 的可靠流动。
-
自定义指标标记:借助对 Graphite 标签的支持,用户可以使用 Graphite 插件来增强指标的粒度。使用相关信息(例如应用程序环境或服务类型)标记指标可以实现更精细的查询和分析,从而使团队能够深入研究特定感兴趣的领域,以获得更好的运营见解。
-
增强的数据清理:利用插件的严格清理选项,用户可以确保其指标名称符合 Graphite 的要求。这种主动措施消除了指标名称中无效字符可能引起的问题,从而实现更简洁的数据管理和更准确的可视化。
反馈
感谢您成为我们社区的一份子!如果您有任何一般反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。