{"id":32616,"date":"2009-04-24T17:23:34","date_gmt":"2009-04-24T09:23:34","guid":{"rendered":"https:\/\/www.fuhaijun.com\/?p=32616"},"modified":"2009-04-24T17:23:34","modified_gmt":"2009-04-24T09:23:34","slug":"snmpwalk%e7%94%a8%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.fuhaijun.com\/?p=32616","title":{"rendered":"snmpwalk\u7528\u6cd5"},"content":{"rendered":"<h6>&#160;<\/h6>\n<p>SNMPWALK(1)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Net-SNMP&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SNMPWALK(1)<\/p>\n<p>NAME   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; snmpwalk &#8211; communicates with a network entity using SNMP GETNEXT requests.<\/p>\n<p>SYNOPSIS   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; snmpwalk [APPLICATION OPTIONS] [COMMON OPTIONS] [OID]<\/p>\n<p>DESCRIPTION   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; snmpwalk&#160; is an SNMP application that uses SNMP GETNEXT requests to query a network entity for a tree    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; of information.<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; An object identifier (OID) may be given on the command line.&#160; This OID specifies which portion of the   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; object&#160; identifier space will be searched using GETNEXT requests.&#160; All variables in the subtree below    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; the given OID are queried and their values presented to the user.&#160; Each variable name is given in the    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; format specified in variables(5).<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; If&#160; no&#160; OID argument is present, snmpwalk will search MIB-2.&#160; If the network entity has an error pro-   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; cessing the request packet, an error packet will be returned and a message will be shown, helping&#160; to    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; pinpoint why the request was malformed.<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; If the tree search causes attempts to search beyond the end of the MIB, the message &quot;End of MIB&quot; will   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; be displayed.<\/p>\n<p>OPTIONS   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; -Cc&#160;&#160;&#160;&#160; Do not check whether the returned OIDs are increasing.&#160; Some agents (LaserJets are&#160; an&#160; exam-    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ple)&#160; return&#160; OIDs&#160; out of order, but can complete the walk anyway.&#160; Other agents return OIDs    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; that are out of order and can cause snmpwalk to&#160; loop&#160; indefinitely.&#160;&#160; By&#160; default,&#160; snmpwalk    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; tries&#160; to detect this behavior and warns you when it hits an agent acting illegally.&#160; Use -Cc    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; to turn off this behaviour.<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; -Ci&#160;&#160;&#160;&#160; Include the given OID in the search range.&#160; Normally snmpwalk uses GETNEXT requests&#160; starting   <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; with&#160; the&#160; OID&#160; you&#160; specified and returns all results in the MIB tree after that OID.&#160; Some-    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; times, you may wish to include the OID specified on the command line in the&#160; printed&#160; results    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if it is a valid OID in the tree itself.&#160; This option lets you do this.<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; -Cp&#160;&#160;&#160;&#160; Upon completion of the walk, print the number of variables found.<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; -Ct&#160;&#160;&#160;&#160; Upon&#160; completion of the walk, print the total wall-clock time it took to collect the data (in   <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; seconds).&#160; Note that the timer is started just before&#160; the&#160; beginning&#160; of&#160; the&#160; data&#160; request    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; series&#160; and&#160; stopped&#160; just&#160; after it finishes.&#160; Most importantly, this means that it does not    <br \/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; include snmp library initialization, shutdown, argument processing, and any other overhead.<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; In addition to these options, snmpwalk takes the common options described in&#160; the&#160; snmpcmd(1)&#160; manual   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; page.<\/p>\n<p>EXAMPLE   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; The command:<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; snmpwalk -Os -c public -v 1 zeus system<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; will retrieve all of the variables under system:<\/p>\n<p>&#160;&#160;&#160;&#160;&#160;&#160; sysDescr.0 = STRING: &quot;SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m&quot;   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; sysObjectID.0 = OID: enterprises.hp.nm.hpsystem.10.1.1    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; sysUpTime.0 = Timeticks: (155274552) 17 days, 23:19:05    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; sysContact.0 = STRING: &quot;&quot;    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; sysName.0 = STRING: &quot;zeus.net.cmu.edu&quot;    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; sysLocation.0 = STRING: &quot;&quot;    <br \/>&#160;&#160;&#160;&#160;&#160;&#160; sysServices.0 = INTEGER: 72<\/p>\n<p>SEE ALSO   <br \/>&#160;&#160;&#160;&#160;&#160;&#160; snmpcmd(1), snmpbulkwalk(1), variables(5).<\/p>\n<p>4th Berkeley Distribution&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 08 Feb 2002&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SNMPWALK(1)<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;   <br \/>from Redhat Linux AS4 &quot;man snmpwalk&quot;<\/p>\n<p>snmpwalk\u8bed\u6cd5\uff1a   <br \/>snmpwalk \u4ea4\u6362\u673a\u6216\u8def\u7531\u5668IP\u5730\u5740 -c SNMP\u8bfb\u5bc6\u7801 -v 1\u62162(\u4ee3\u8868SNMP\u7248\u672c) OID(\u5bf9\u8c61\u6807\u793a\u7b26)<\/p>\n<p>\u7528\u6cd5\u4e3e\u4f8b:   <br \/>1\u3001snmpwalk -c public -v 1 -m ALL 192.168.30.49 .1.3.6.1.2.1.25.1&#160;&#160;&#160; \u5f97\u5230\u53d6\u5f97windows\u7aef\u7684\u7cfb\u7edf\u8fdb\u7a0b\u7528\u6237\u6570\u7b49<\/p>\n<p>2\u3001snmpwalk -c public -v 1 -m ALL 192.168.30.49 .1.3.6.1.2.1.25.2.2&#160; \u53d6\u5f97\u7cfb\u7edf\u603b\u5185\u5b58   <br \/>3\u3001snmpwalk -c public -v 1 -m ALL 192.168.30.49 hrSystemNumUsers    <br \/>4\u3001snmpwalk -c public -v 1 -m ALL 192.168.30.49 .1.3.6.1.2.1.4.20&#160;&#160;&#160; \u53d6\u5f97IP\u4fe1\u606f<\/p>\n<p>5\u3001snmpwalk -v 2c -c public 192.168.30.49 system&#160;&#160; \u67e5\u770b\u7cfb\u7edf\u4fe1\u606f<\/p>\n<p>6\u3001snmpwalk -v 1 192.168.30.49 -c public ifDescr<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#160; SNMPWALK(1)&#160;&#160;&#160;&#160;&#160;&#160;&#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32616","post","type-post","status-publish","format-standard","hentry","category-default"],"_links":{"self":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/32616"}],"collection":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32616"}],"version-history":[{"count":0,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=\/wp\/v2\/posts\/32616\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhaijun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}