AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1205546

Impy77's questions

Martin Hope
Impy77
Asked: 2025-01-13 20:52:03 +0800 CST

SNMP 陷阱未记录

  • 5

(抱歉,我把原文发到了错误的论坛)

我正在 Alma 9 上设置 Zabbix,在 SNMP 陷阱方面遇到了一个奇怪的问题。我们的 sip 交换机启用了 SNMP 并指向服务器,但出于某种原因 snmptrapd 不处理传入的陷阱

Zabbix 已安装并正在运行。snmp 和 trap 正在运行

[root@dev:~]$ ps ax | grep snmp
   1472 ?        S      0:00 /usr/sbin/zabbix_server: snmp trapper [processed data in 0.000060 sec, idle 1 sec]
   1527 ?        Sl     0:00 /usr/sbin/zabbix_server: snmp poller #1 [got 0 values, queued 0 in 5 sec, awaiting 0]
   2174 ?        Ss     0:00 /usr/sbin/snmptrapd -Lsd -f
   2585 pts/1    S+     0:00 grep --color=auto snmp

运行 snmptrapwalk 有效

snmptrap -v 2c -c public 10.5.5.122 '' SNMPv2-MIB::snmpMIB IF-MIB::linkDown s eth0

2025-01-10T16:51:09+0000 ZBXTRAP 10.5.5.122
PDU INFO:
  receivedfrom                   UDP: [10.5.5.122]:47786->[10.5.5.122]:162
  version                        1
  transactionid                  2
  requestid                      1130383097
  errorstatus                    0
  messageid                      0
  notificationtype               TRAP
  errorindex                     0
  community                      public
VARBINDS:
  DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (337607) 0:56:16.07
  SNMPv2-MIB::snmpTrapOID.0      type=6  value=OID: SNMPv2-MIB::snmpMIB
  IF-MIB::linkDown               type=4  value=STRING: "eth0"

在我们的 SIP 交换机上,如果我重新启动其中一个模块,它会触发 snmpt trap。使用 TCP dump,我可以将其发送到 zabbix 服务器

tcpdump -i ens18 -T snmp -n dst portrange 161-162

17:14:35.573815 IP 10.7.7.113.33830 > 10.5.5.122.snmptrap:  V2Trap(174)  .1.3.6.1.2.1.1.3.0=1877147173 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.17236.2.1 .1.3.6.1.4.1.17236.1.1="CRITICAL : 003 010008 000007 10/01/2025 17:14:35 : Connection to 0XA070771 (SIP Switch 3 - BT) lost"
17:14:36.427854 IP 10.7.7.113.43173 > 10.5.5.122.snmptrap:  V2Trap(152)  .1.3.6.1.2.1.1.3.0=1877147258 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.17236.2.1 .1.3.6.1.4.1.17236.1.1="CRITICAL : 003 010000 000000 10/01/2025 17:14:36 : Application Server stopped"
17:14:37.434487 IP 10.7.7.113.54710 > 10.5.5.122.snmptrap:  V2Trap(222)  .1.3.6.1.2.1.1.3.0=1877147359 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.17236.2.1 .1.3.6.1.4.1.17236.1.1="MAJOR    : 007 023009 000000 10/01/2025 17:14:37 : Shout.Ocp.OcpLink (127.0.0.1:10012) has failed.  Reason: Unexpected error in Heartbeat thread."
17:14:41.627673 IP 10.7.7.113.34462 > 10.5.5.122.snmptrap:  V2Trap(230)  .1.3.6.1.2.1.1.3.0=1877147778 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.17236.2.1 .1.3.6.1.4.1.17236.1.1="MAJOR    : 007 023009 000000 10/01/2025 17:14:41 : Shout.Ocp.OcpLink (127.0.0.1:10012) has failed.  Reason: Unable to read beyond the end of the stream..

是的,日志中没有任何内容。这是我在 /etc/snmp/snmptrap.conf 中看到的内容。

#Zabbix 1 and 2
disableAuthorization yes
authCommunity execute public

#Zabbix SNMP trap receiver
perl do "/usr/bin/zabbix_trap_receiver.pl";

我也尝试过使用 bash 脚本,但仍然没有成功。Selinux 被禁用,防火墙也是如此。我没有收到任何错误消息,/var/log/messages 中也没有显示任何问题。我有点困惑,因为似乎没有什么问题。

snmp
  • 1 个回答
  • 43 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve