转发SNMP GET请求

我有一个Linux服务器集群和一个(网关)Linux服务器,可以通过主机名或IP访问集群中的机器。 从集群外部,机器不能通过主机名或IP进行访问

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

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

有没有人知道现有的解决scheme?

谢谢!

你正在寻找的是一个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,创build一个社区string(例如H_comm),将其映射到上下文(H_context),然后将发送到具有社区H_comm的网关的所有查询代理为H

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

“公共”是H上的社区名称。