转发 SNMP GET 请求

转发 SNMP GET 请求

我有一组 Linux 服务器和一个 (网关) Linux 服务器,可以通过主机名或 IP 访问集群中的计算机。集群外部的计算机无法通过主机名或 IP 访问

我想在集群内的服务器上发出 SNMP 获取 OID 的请求,并通过网关服务器传递该请求。

为了做到这一点,网关需要以某种方式转发它收到的针对集群中其他机器的 SNMP 获取请求,并将答复转发给原始请求者。

有人知道这个问题的现有解决方案吗?

谢谢!

答案1

您正在寻找的是 snmp 代理。Net-snmp 可以做到这一点。

   proxy [-Cn CONTEXTNAME] [SNMPCMD_ARGS] HOST OID [REMOTEOID]
          will pass any incoming requests under OID to the agent listening on the port specified by the transport  address  HOST.
          See  the  section  LISTENING  ADDRESSES  in the snmpd(8) manual page for more information about the format of listening
          addresses.

          Note:  To proxy the entire MIB tree, use the OID .1.3 (not the top-level .1)

例如,为集群中的每个主机 H 创建一个社区字符串(例如 H_comm),将其映射到上下文(H_context),然后将发送到网关的所有查询与社区 H_comm 一起代理到 H,如下所示

proxy -Cn H_context -v 2c -c public H .1.3

“public” 是 H 上的社区名称。

相关内容