SNMP查询IP侦听端口

时间:2013-12-28 17:35:17

标签: snmp nagios

我想用SNMP查询远程主机的监听端口。

使用snmpwalk显示:

# snmpwalk -c public -v2c somehost TCP-MIB::tcpListenerProcess.ipv4
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".13 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".22 = Gauge32: 0
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".111 = Gauge32: 0
...

但我无法查询特定端口(作为监控软件 - nagios - 会这样做):

# snmpget -c public -v2c localhost TCP-MIB::tcpListenerProcess.ipv4.\"0.0.0.0\".111
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".111 = No Such Instance currently exists at this OID

我试图放置一些特殊的shell保护但没有成功:

# snmpget -c public -v2c localhost 'TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".111'
TCP-MIB::tcpListenerProcess.ipv4."0.0.0.0".111 = No Such Instance currently exists at 

# snmpget -c public -v2c localhost 'TCP-MIB::tcpListenerProcess.ipv4.\"0.0.0.0\".111'
TCP-MIB::tcpListenerProcess.ipv4.\"0.0.0.0\".111: Unknown Object Identifier (Index out of range: \"0 (tcpListenerLocalAddress))

有人可以对此有所了解,并且可能会提示如何正确查询此OID吗?

0 个答案:

没有答案