{"id":4010,"date":"2024-07-30T21:57:27","date_gmt":"2024-07-30T21:57:27","guid":{"rendered":"https:\/\/wiki.thomasandsofia.com\/?p=4010"},"modified":"2024-08-01T17:37:25","modified_gmt":"2024-08-01T17:37:25","slug":"understanding-snmp-walks","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=4010","title":{"rendered":"Understanding SNMP walks"},"content":{"rendered":"<h3><strong>SNMP v2 Walk Command<\/strong><\/h3>\n<p><strong>Walk the device to see what might be interesting on it.<\/strong><\/p>\n<pre>snmpwalk -v2c -c COMMUNITY IP.ADD.RE.SS\r\nsnmpwalk -v2c -c netbotz 10.90.34.172:1024\r\n# To view all MIBs\r\nsnmpwalk -v2c -c netbotz -m all 10.90.34.172:1024<\/pre>\n<p>Note: This might limit the results of the walk. To view EVERYTHING, start at &#8216;.1&#8217;<\/p>\n<pre>snmpwalk -v2c -c netbotz -m all 10.90.34.172:1024 .1<\/pre>\n<h3>Understanding SNMP walks<\/h3>\n<p>Return values:<\/p>\n<ul>\n<li>INTEGER: <span class=\"\"> -2^31 to 2^31-1, or -2,147,483,648 to 2,147,483,647<\/span>\n<ul>\n<li>Also used for enumerations: 1 (Up), 2 (Down), 3 (Testing), 4 (Unknown)<\/li>\n<li>Does <strong>not<\/strong> return floating point values. All numeric values are integers.<\/li>\n<li>As such, a value like 26.5 MIGHT be returned as 265\n<ul>\n<li>STRING values may be included to show the actual value, but these are &#8220;strings&#8221;. (Think binary)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Counter32: <span class=\"\"> -2^31 to 2^31-1, or -2,147,483,648 to 2,147,483,647 (Same as Integers)<br \/>\n<\/span><\/p>\n<ul>\n<li>Not used for enumerations, so does not allow the text identifier<\/li>\n<li><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>SNMP has 2 types of OIDs:<\/h4>\n<ul>\n<li>Scaler: Only a single value\n<ul>\n<li>Always end in .0\n<ul>\n<li>Use the .0 in Zenoss Monitoring Templates!<\/li>\n<\/ul>\n<\/li>\n<li>Device level?<\/li>\n<\/ul>\n<\/li>\n<li>Tables: Multiple values for a device\n<ul>\n<li>OIDs ending in non Zero are rows in a table<\/li>\n<li>Component level?<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Example:<\/strong><\/p>\n<pre>IF-MIB::ifNumber.0 = INTEGER: 2\r\nIF-MIB::ifIndex.1 = INTEGER: 1\r\nIF-MIB::ifIndex.2 = INTEGER: 2\r\nIF-MIB::ifDescr.1 = STRING: lo\r\nIF-MIB::ifDescr.2 = STRING: eth0\r\n...\r\nIF-MIB::ifSpeed.1 = Gauge32: 10000000\r\nIF-MIB::ifSpeed.2 = Gauge32: 100000000<\/pre>\n<ul>\n<li>Note: &#8216;if&#8217; stands for InterFace<\/li>\n<li>ifNumber.0 is Scaler.\n<ul>\n<li>Tells us there are 2 interfaces<\/li>\n<\/ul>\n<\/li>\n<li>ifIndex.1 and ifIndex.2 are rows in a table.\n<ul>\n<li>Values define the index number for each interface.<\/li>\n<\/ul>\n<\/li>\n<li>ifDescr.x: Description (Name) of each interface<\/li>\n<li>ifSpeed.x: Interface speed in bps<\/li>\n<\/ul>\n<p>Note: For &#8220;less obvious&#8221; OID translation, you&#8217;ll need to search or use the MIB to understand what they are: (Get the full OID shown below and search for that!)<\/p>\n<h4>Translating a &#8220;friendly&#8221; OID description to numerical format<\/h4>\n<p>Use the Friendly Name as the Data Source.Data Point name and the OID as the value to collect in your Monitoring Templates.<\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>For scaler values, you must add the <strong>.0<\/strong> at the end of the OID!<\/li>\n<li>It doesn&#8217;t seem to matter if the OID starts with the initial &#8216;.&#8217; (dot) or not.<\/li>\n<\/ul>\n<pre>snmptranslate -On MIB_NAME::FRIENDLY_NAME.x\r\nsnmptranslate -On IF-MIB::ifNumber.0\r\n&gt; .1.3.6.1.2.1.2.1.0\r\nsnmptranslate -On IF-MIB::ifSpeed\r\n&gt; .1.3.6.1.2.1.2.2.1.5\r\nsnmptranslate -On IF-MIB::ifSpeed.2\r\n&gt; .1.3.6.1.2.1.2.2.1.5.2<\/pre>\n<h3>Walking a MIB<\/h3>\n<p>See what is unique to a device by walking its MIB using smidump<\/p>\n<pre>smidump -f identifiers \/PATH\/TO\/MIB\/MIB-NAME.mib\r\n# Filter what you're looking for\r\nsmidump -f identifiers \/PATH\/TO\/MIB\/MIB-NAME.mib | grep -Ei SEARCH_TEXT\r\nsmidump -f identifiers \/usr\/share\/snmp\/mibs\/NETBOTZV2-MIB.mib | grep -Ei temp\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SNMP v2 Walk Command Walk the device to see what might be interesting on it. snmpwalk -v2c -c COMMUNITY IP.ADD.RE.SS snmpwalk -v2c -c netbotz 10.90.34.172:1024 # To view all MIBs snmpwalk -v2c -c netbotz -m all 10.90.34.172:1024 Note: This might limit the results of the walk. To view EVERYTHING, start at &#8216;.1&#8217; snmpwalk -v2c -c ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=4010\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4010","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/4010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4010"}],"version-history":[{"count":5,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/4010\/revisions"}],"predecessor-version":[{"id":4018,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/4010\/revisions\/4018"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}