2008年(91)
分类: LINUX
2008-03-23 00:27:58
snmpwalk - retrieve a subtree of management values using SNMP GETNEXT requests
snmpwalk is an SNMP application that uses SNMP GETNEXT requests to query a network entity for a tree of information.
An object identifier (OID) may be given on the command line. This OID specifies which portion of the object identifier space will be searched using GETNEXT requests. All variables in the subtree below the given OID are queried and their values presented to the user. Each variable name is given in the format specified in variables(5).
If no OID argument is present, snmpwalk will search the subtree rooted at SNMPv2-SMI::mib-2 (including any MIB object values from other MIB modules, that are defined as lying within this subtree). If the network entity has an error processing the request packet, an error packet will be returned and a message will be shown, helping to pinpoint why the request was malformed.
If the tree search causes attempts to search beyond the end of the MIB, the message "End of MIB" will be displayed.
以上是对snmpwalk的解释。
下面是常用到的命令
/usr/local/bin/snmpwalk -v
抓取ip,这个下面接的所有服务器的mac.但是我在工作中遇到的是ip为核心交换机的。才能抓到其下的所有的服务器的mac。如果是2层交换机的IP。而本机是在其他的交换机下的服务器,则就抓不到了哦。