轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥7起我的订单
文档
工具
提交工单页面收录
热门搜索:
snmp-notifier

maxwo/snmp-notifier

maxwo

基于SNMP协议的通知发送工具镜像,用于监控系统中事件告警及状态通知的高效传递。

2 次收藏下载次数: 0状态:社区镜像维护者:maxwo仓库类型:镜像最近更新:5 个月前
让 AI 帮你使用轩辕镜像? · 展开查看说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

中文简介
标签列表
镜像标签列表与下载命令
轩辕镜像,快一点,稳很多。
点击查看

SNMP Notifier

镜像概述和主要用途

snmp_notifier 接收来自 Prometheus Alertmanager 的告警,并将其作为 SNMP 陷阱进行路由。该工具主要用于与较旧的监控和告警系统(如 Nagios 或 Centreon)集成,实现 Prometheus 告警向传统 SNMP 监控系统的转发。

核心功能和特性

  • 接收 Prometheus Alertmanager 发送的告警并转换为 SNMP 陷阱
  • 支持 SNMP v2c 和 v3 版本
  • 为每个陷阱分配唯一 ID,支持告警更新或解决时发送状态更新
  • 允许通过告警标签指定 OID,或使用默认 OID
  • 支持自定义陷阱描述模板和用户定义对象
  • 可配置的告警严重性处理机制
  • 提供 Web 接口用于接收告警和暴露指标

使用场景和适用范围

  • 需要将 Prometheus 告警集成到现有 SNMP 监控基础设施的环境
  • 企业级监控系统中需要统一告警通知渠道的场景
  • 需要向传统网络管理系统转发云原生环境告警的场合
  • 混合 IT 环境中实现统一告警管理的需求

安装方法

Helm Chart 安装

SNMP notifier 图表可通过 https://github.com/prometheus-community/helm-charts 获取:

console
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install snmp-notifier prometheus-community/alertmanager-snmp-notifier --set 'snmpNotifier.snmpDestinations={my-snmp-server:162}'

请参考 https://github.com/prometheus-community/helm-charts/blob/main/charts/alertmanager-snmp-notifier/values.yaml 查看可用配置选项。

Docker 镜像安装

Docker 镜像可在 https://hub.docker.com/r/maxwo/snmp-notifier 获取:

console
docker pull maxwo/snmp-notifier

预编译二进制文件

预编译二进制文件可在项目的 https://github.com/maxwo/snmp_notifier/releases 获取。

手动编译

console
git clone https://github.com/maxwo/snmp_notifier.git
cd snmp_notifier
make build
./snmp_notifier

使用方法和配置说明

Docker 运行示例

console
docker run -d -p 9464:9464 \
  -e SNMP_NOTIFIER_COMMUNITY=my-secret-community \
  maxwo/snmp-notifier \
  --snmp.version=V2c \
  --snmp.destination=snmp-server:162 \
  --alert.severity-label=severity \
  --log.level=info

Docker Compose 配置示例

yaml
version: '3'
services:
  snmp-notifier:
    image: maxwo/snmp-notifier
    ports:
      - "9464:9464"
    environment:
      - SNMP_NOTIFIER_COMMUNITY=my-secret-community
    command:
      - --snmp.version=V2c
      - --snmp.destination=snmp-server:162
      - --alert.severity-label=severity
      - --log.level=info
    restart: unless-stopped

Prometheus 告警配置

可在告警标签中添加 OID 以标识要发送的陷阱类型:

如果未在告警中找到 OID,SNMP notifier 会使用默认 OID。这在希望所有告警共享相同 OID 时非常有用。

yaml
groups:
  - name: service
    rules:
      - alert: ServiceIsDown
        expr: up == 0
        for: 5m
        labels:
          severity: "critical"
          type: "service"
          oid: "1.3.6.1.4.1.123.0.10.1.1.1.5.1"
          environment: "production"
        annotations:
          description: "服务 {{ $labels.job }} 在 {{ $labels.instance }} 上已宕机"
          summary: "服务宕机告警"

Alertmanager 配置

应将 Alertmanager 配置为使用 SNMP notifier 作为告警接收器:

yaml
receivers:
  - name: "snmp_notifier"
    webhook_configs:
      - send_resolved: true
        url: http://snmp.notifier.service:9464/alerts

注意,send_resolved 选项允许 notifier 将陷阱状态更新为正常。

SNMP Notifier 配置

命令行参数

启动 snmp_notifier 可执行文件时使用 --help 标志查看可用选项:

console
$ ./snmp_notifier --help
usage: snmp_notifier [<flags>]

用于将 Prometheus 告警中继为 SNMP 陷阱的工具


标志:
  -h, --[no-]help                显示上下文相关帮助(也可尝试 --help-long 和 --help-man)。
      --web.listen-address=:9464 ...  
                                 用于公开指标和 Web 界面的地址。可重复多次指定多个地址。
                                 示例: `:9100` 或 `[::1]:9100` (HTTP), `vsock://:9100` (vsock)
      --web.config.file=""       可启用 TLS 或身份验证的配置文件路径。
                                 参见: https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md
      --alert.severity-label="severity"  
                                 用于查找告警严重性的标签。
      --alert.severities="critical,warning,info"  
                                 告警严重性的有序列表,从高优先级到低优先级。
      --alert.default-severity="critical"  
                                 未通过标签提供时使用的默认告警严重性。
      --snmp.version=V2c         SNMP 版本。当前支持 V2c 和 V3。
      --snmp.destination=127.0.0.1:162 ...  
                                 SNMP 陷阱服务器目标地址。
      --snmp.retries=1           SNMP 重试次数
      --snmp.timeout=5s          SNMP 超时时间
      --snmp.community="public"  SNMP 社区 (仅 V2c)。不建议通过命令行传递密钥,
                                 考虑使用 SNMP_NOTIFIER_COMMUNITY 环境变量替代。 ($SNMP_NOTIFIER_COMMUNITY)
      --[no-]snmp.authentication-enabled  
                                 启用 SNMP 身份验证 (仅 V3)。
      --snmp.authentication-protocol=MD5  
                                 密码加密协议 (仅 V3)。当前支持 MD5 和 SHA。
      --snmp.authentication-username=USERNAME  
                                 SNMP 身份验证用户名 (仅 V3)。不建议通过命令行传递密钥,
                                 考虑使用 SNMP_NOTIFIER_AUTH_USERNAME 环境变量替代。 ($SNMP_NOTIFIER_AUTH_USERNAME)
      --snmp.authentication-password=PASSWORD  
                                 SNMP 身份验证密码 (仅 V3)。不建议通过命令行传递密钥,
                                 考虑使用 SNMP_NOTIFIER_AUTH_PASSWORD 环境变量替代。 ($SNMP_NOTIFIER_AUTH_PASSWORD)
      --[no-]snmp.private-enabled  
                                 启用 SNMP 加密 (仅 V3)。
      --snmp.private-protocol=DES  
                                 SNMP 数据传输协议 (仅 V3)。当前支持 DES 和 AES。
      --snmp.private-password=SECRET  
                                 SNMP 私有密码 (仅 V3)。不建议通过命令行传递密钥,
                                 考虑使用 SNMP_NOTIFIER_PRIV_PASSWORD 环境变量替代。 ($SNMP_NOTIFIER_PRIV_PASSWORD)
      --snmp.security-engine-id=SECURITY_ENGINE_ID  
                                 SNMP 安全引擎 ID (仅 V3)。
      --snmp.context-engine-id=CONTEXT_ENGINE_ID  
                                 SNMP 上下文引擎 ID (仅 V3)。
      --snmp.context-name=CONTEXT_ENGINE_NAME  
                                 SNMP 上下文名称 (仅 V3)。
      --snmp.engine-start-time=""  
                                 指定引擎启动时间的 UNIX 时间戳(秒)。默认为主机启动时间。
      --trap.default-oid="1.3.6.1.4.1.98789.1"  
                                 默认陷阱 OID。
      --trap.oid-label="oid"     包含自定义陷阱 OID 的标签。
      --trap.resolution-default-oid=TRAP.RESOLUTION-DEFAULT-OID  
                                 解决状态陷阱 OID,如果与触发状态陷阱 OID 不同。
      --trap.resolution-oid-label=TRAP.RESOLUTION-OID-LABEL  
                                 包含自定义解决状态陷阱 OID 的标签,如果与触发状态陷阱 OID 不同。
      --trap.default-objects-base-oid="1.3.6.1.4.1.98789.2"  
                                 默认陷阱对象的基础 OID。
      --trap.description-template=description-template.tpl  
                                 陷阱描述模板。
      --trap.user-objects-base-oid="1.3.6.1.4.1.98789.3"  
                                 用户定义陷阱对象的基础 OID。
      --trap.user-object=4=user-object-template.tpl ...  
                                 用户对象子 OID 和模板,例如 --trap.user-object=4=new-object.template.tpl
                                 用于添加子对象到陷阱,使用给定的模板文件。可多次使用此标志添加多个用户对象。
      --log.level=info           仅记录指定严重性或更高级别的消息。选项: [debug, info, warn, error]
      --log.format=logfmt        日志消息输出格式。选项: [logfmt, json]
      --[no-]version             显示应用程序版本。

环境变量

建议使用以下环境变量设置 SNMP 密钥:

环境变量配置说明默认值
SNMP_NOTIFIER_COMMUNITYSNMP v2c 社区字符串public
SNMP_NOTIFIER_AUTH_USERNAMESNMP v3 身份验证用户名
SNMP_NOTIFIER_AUTH_PASSWORDSNMP v3 身份验证密码
SNMP_NOTIFIER_PRIV_PASSWORDSNMP v3 私有(或服务器)密码

使用示例

简单用法

以下是使用默认配置接收的 2 个示例陷阱,包括 2 个触发状态的告警和 1 个已解决的告警。

陷阱包含 3 个字段:

  • 陷阱唯一 ID
  • 告警/陷阱状态
  • 告警描述
console
$ snmptrapd -m ALL -m +SNMP-NOTIFIER-MIB -f -Of -Lo -c scripts/snmptrapd.conf
 Agent Address: 0.0.0.0
 Agent Hostname: localhost
 Date: 1 - 0 - 0 - 1 - 1 - 1970
 Enterprise OID: .
 Trap Type: Cold Start
 Trap Sub-Type: 0
 Community/Infosec Context: TRAP2, SNMP v2c, community public
 Uptime: 0
 Description: Cold Start
 PDU Attribute/Value Pair Array:
.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance = Timeticks: (853395100) 98 days, 18:32:31.00
.iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 = OID: .iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierDefaultTrap
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsObjects.snmpNotifierAlertId = STRING: "1.3.6.1.4.1.98789[environment=production,label=test]"
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsObjects.snmpNotifierAlertSeverity = STRING: "critical"
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsObjects.snmpNotifierAlertDescription = STRING: "2/3 告警正在触发:

状态: critical
- 告警: TestAlert
  摘要: this is the summary
  描述: this is the description on job1

状态: warning
- 告警: TestAlert
  摘要: this is the random summary
  描述: this is the description of alert 1"
 --------------

使用用户自定义对象

可通过 --trap.user-object 参数添加额外字段。

例如,使用模板 {{ len .Alerts }} 告警正在触发。 并通过 --trap.user-object=4=alert-count.tpl 参数指定,将生成:

console
$ snmptrapd -m ALL -m +SNMP-NOTIFIER-MIB -f -Of -Lo -c scripts/snmptrapd.conf
 Agent Address: 0.0.0.0
 Agent Hostname: localhost
 Date: 1 - 0 - 0 - 1 - 1 - 1970
 Enterprise OID: .
 Trap Type: Cold Start
 Trap Sub-Type: 0
 Community/Infosec Context: TRAP2, SNMP v2c, community public
 Uptime: 0
 Description: Cold Start
 PDU Attribute/Value Pair Array:
.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance = Timeticks: (2665700) 7:24:17.00
.iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 = OID: .iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierDefaultTrap
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsObjects.snmpNotifierAlertId = STRING: "1.3.6.1.4.1.98789[environment=production,label=test]"
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsObjects.snmpNotifierAlertSeverity = STRING: "critical"
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsObjects.snmpNotifierAlertDescription = STRING: "2/3 告警正在触发:

状态: critical
- 告警: TestAlert
  摘要: this is the summary
  描述: this is the description on job1

状态: warning
- 告警: TestAlert
  摘要: this is the random summary
  描述: this is the description of alert 1"
.iso.org.dod.internet.private.enterprises.snmpNotifier.snmpNotifierAlertsUserObjects.4 = STRING: "2 告警正在触发。"
--------------

模板使用

陷阱描述模板支持任何 Go 模板指令。用户可通过 --trap.description-template 参数指定自定义模板文件来自定义陷阱描述格式。

同样,用户对象模板也支持 Go 模板语法,可用于创建自定义的 SNMP 对象输出。

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 snmp-notifier 镜像标签

docker pull docker.xuanyuan.run/maxwo/snmp-notifier:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull maxwo/snmp-notifier:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

iKuai 镜像加速

宝塔面板

一键配置镜像源

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

一键安装

一键安装 Docker

Linux Docker 一键安装

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

免费版与专业版区别

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
maxwo/snmp-notifier
教程轩辕镜像功能与使用教程
定价查看流量套餐与价格
热门查看热门 Docker 镜像推荐
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像

高速镜像下载 · 在线技术支持 · 99.95% SLA 保障

50GB 仅 ¥7/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载·在线技术支持·99.95% SLA 保障
商务合作:点击复制邮箱
用户协议·隐私政策·©2024-2026 源码跳动
用户协议·隐私政策©2024-2026 杭州源码跳动科技有限公司商务合作:点击复制邮箱

更多 snmp-notifier 镜像推荐

zabbix/zabbix-snmptraps logo

zabbix/zabbix-snmptraps

zabbix
接收SNMP陷阱并提供给Zabbix服务器或代理的Docker镜像,用于存储陷阱消息到日志文件,支持多种操作系统基础镜像和版本标签。
29 次收藏500万+ 次下载
16 天前更新
mirantis/ucp-sf-notifier logo

mirantis/ucp-sf-notifier

mirantis
暂无描述
10万+ 次下载
24 天前更新
starlingx/stx-snmp logo

starlingx/stx-snmp

starlingx
StarlingX是一个开源分布式云平台。更多信息请访问:https://www.starlingx.io/
1 次收藏1万+ 次下载
16 天前更新
concourse/concourse-slack-notifier logo

concourse/concourse-slack-notifier

concourse
暂无描述
50万+ 次下载
6 年前更新
okteto/slack-notifier logo

okteto/slack-notifier

okteto
暂无描述
563 次下载
7 年前更新
femtopixel/github-release-notifier logo

femtopixel/github-release-notifier

femtopixel
GitHub Release Notifier是一个用于通知GitHub项目新版本发布的多架构工具,可通过Docker部署,支持持久化存储和Webhook订阅,帮助用户及时获取关注项目的更新信息。
2 次收藏1万+ 次下载
2 年前更新

查看更多 snmp-notifier 相关镜像