文档文档

OpenSMTPD 输入插件

此插件使用 smtpctl 二进制文件从 OpenSMTPD 收集统计信息。

smtpctl 二进制文件必须存在于系统上,并且 Telegraf 可以执行它。该插件支持使用 sudo 进行执行。

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

全局配置选项

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

配置

# A plugin to collect stats from Opensmtpd - a validating, recursive, and caching DNS resolver
 [[inputs.opensmtpd]]
   ## If running as a restricted user you can prepend sudo for additional access:
   #use_sudo = false

   ## The default location of the smtpctl binary can be overridden with:
   binary = "/usr/sbin/smtpctl"

   # The default timeout of 1s can be overridden with:
   #timeout = "1s"

权限

请注意,此插件会引用 smtpctl,执行该命令可能需要额外的权限。根据执行此插件的 telegraf 用户的用户/组权限,您可能需要更改组成员资格、设置 facls 或使用 sudo。

$ groups telegraf
telegraf : telegraf

$ usermod -a -G opensmtpd telegraf

$ groups telegraf
telegraf : telegraf opensmtpd

Sudo 权限

如果使用此方法,则需要在 telegraf 配置中添加以下内容

[[inputs.opensmtpd]]
  use_sudo = true

您还需要更新您的 sudoers 文件

$ visudo
# Add the following line:
Cmnd_Alias SMTPCTL = /usr/sbin/smtpctl
telegraf  ALL=(ALL) NOPASSWD: SMTPCTL
Defaults!SMTPCTL !logfile, !syslog, !pam_session

请使用您认为最合适的解决方案。

Metrics

这是 smtpctl 提供的所有统计信息的完整列表,根据您的 smtpctl 配置,Telegraf 可能会收集这些信息。

  • smtpctl bounce_envelope bounce_message bounce_session control_session mda_envelope mda_pending mda_running mda_user mta_connector mta_domain mta_envelope mta_host mta_relay mta_route mta_session mta_source mta_task mta_task_running queue_bounce queue_evpcache_load_hit queue_evpcache_size queue_evpcache_update_hit scheduler_delivery_ok scheduler_delivery_permfail scheduler_delivery_tempfail scheduler_envelope scheduler_envelope_expired scheduler_envelope_incoming scheduler_envelope_inflight scheduler_ramqueue_envelope scheduler_ramqueue_message scheduler_ramqueue_update smtp_session smtp_session_inet4 smtp_session_local uptime

示例输出

opensmtpd,host=localhost scheduler_delivery_tempfail=822,mta_host=10,mta_task_running=4,queue_bounce=13017,scheduler_delivery_permfail=51022,mta_relay=7,queue_evpcache_size=2,scheduler_envelope_expired=26,bounce_message=0,mta_domain=7,queue_evpcache_update_hit=848,smtp_session_local=12294,bounce_envelope=0,queue_evpcache_load_hit=4389703,scheduler_ramqueue_update=0,mta_route=3,scheduler_delivery_ok=2149489,smtp_session_inet4=2131997,control_session=1,scheduler_envelope_incoming=0,uptime=10346728,scheduler_ramqueue_envelope=2,smtp_session=0,bounce_session=0,mta_envelope=2,mta_session=6,mta_task=2,scheduler_ramqueue_message=2,mta_connector=7,mta_source=1,scheduler_envelope=2,scheduler_envelope_inflight=2 1510220300000000000

此页面是否有帮助?

感谢您的反馈!


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