{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/snmp_exporter/issues/266","repository_url":"https://api.github.com/repos/prometheus/snmp_exporter","labels_url":"https://api.github.com/repos/prometheus/snmp_exporter/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/snmp_exporter/issues/266/comments","events_url":"https://api.github.com/repos/prometheus/snmp_exporter/issues/266/events","html_url":"https://github.com/prometheus/snmp_exporter/issues/266","id":297780179,"number":266,"title":"Bug Report: Get timeout after disabled SNMP v1 on Cisco-Switch","user":{"login":"Mortinke","id":11607896,"avatar_url":"https://avatars2.githubusercontent.com/u/11607896?v=4","gravatar_id":"","url":"https://api.github.com/users/Mortinke","html_url":"https://github.com/Mortinke","followers_url":"https://api.github.com/users/Mortinke/followers","following_url":"https://api.github.com/users/Mortinke/following{/other_user}","gists_url":"https://api.github.com/users/Mortinke/gists{/gist_id}","starred_url":"https://api.github.com/users/Mortinke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mortinke/subscriptions","organizations_url":"https://api.github.com/users/Mortinke/orgs","repos_url":"https://api.github.com/users/Mortinke/repos","events_url":"https://api.github.com/users/Mortinke/events{/privacy}","received_events_url":"https://api.github.com/users/Mortinke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-16T13:10:57Z","updated_at":"2018-02-16T14:06:47Z","closed_at":null,"author_association":"NONE","body":"### Environment:\r\nHost operating system:\r\n```\r\nLinux myhost 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 26 17:51:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\r\n```\r\n\r\nsnmp_exporter version:\r\n```\r\n# ./snmp_exporter --version\r\nsnmp_exporter, version 0.8.0 (branch: HEAD, revision: 17cefcaf7010106861ce0faa2a9ec9e39b7c2b4b)\r\nbuild user: root@57f813d2791a\r\nbuild date: 20171120-12:36:57\r\ngo version: go1.9.2\r\n```\r\n\r\nUsed devices / snmpwald OID:\r\nused devices:\r\n```\r\nWS-C3850-48P (Cisco Catalyst 3850)\r\nVersion 03.06.07E\r\n```\r\n\r\nusing provided OIDs from default snmp.yml \"apcups\"\r\n```\r\napcups:\r\n  version: 2\r\n  max_repetitions: 25\r\n  retries: 1\r\n  timeout: 30s\r\n  auth:\r\n    community: ****\r\n  walk:\r\n  - 1.3.6.1.2.1.1.3\r\n  - 1.3.6.1.2.1.2\r\n  - 1.3.6.1.4.1.318.1.1.1.12\r\n  - 1.3.6.1.4.1.318.1.1.1.2\r\n  - 1.3.6.1.4.1.318.1.1.1.3\r\n  - 1.3.6.1.4.1.318.1.1.1.4\r\n  - 1.3.6.1.4.1.318.1.1.1.7.2\r\n  - 1.3.6.1.4.1.318.1.1.1.8.1\r\n  - 1.3.6.1.4.1.318.1.1.10.2.3.2\r\n  metrics:\r\n\t...\r\n```\r\n\r\n### Error description\r\n\r\n#### What did you do that produced an error?\r\n\r\nFirstly, I run the snmp_exporter with snmp v1 + v2 activated on target switch and got all information:\r\n```\r\ncurl \"http://myhost:9116/snmp?target=myswitch&module=apcups\"\r\n```\r\nHere you can find the debug output for this run:\r\n```\r\n# ./snmp_exporter --log.level=\"debug\" --config.file=\"snmp.yml\"\r\nINFO[0000] Starting snmp exporter (version=0.8.0, branch=HEAD, revision=17cefcaf7010106861ce0faa2a9ec9e39b7c2b4b)  source=\"main.go:125\"\r\nINFO[0000] Build context (go=go1.9.2, user=root@57f813d2791a, date=20171120-12:36:57)  source=\"main.go:126\"\r\nINFO[0000] Listening on :9116                            source=\"main.go:205\"\r\nDEBU[0003] Scraping target 'myswitch' with module 'apcups'  source=\"main.go:73\"\r\nDEBU[0003] Walking target \"myswitch\" subtree \"1.3.6.1.2.1.1.3\"  source=\"collector.go:71\"\r\nDEBU[0003] Walk of target \"myswitch\" subtree \"1.3.6.1.2.1.1.3\" completed in 8.297073ms  source=\"collector.go:81\"\r\nDEBU[0003] Walking target \"myswitch\" subtree \"1.3.6.1.2.1.2\"  source=\"collector.go:71\"\r\nDEBU[0012] Walk of target \"myswitch\" subtree \"1.3.6.1.2.1.2\" completed in 8.985154064s  source=\"collector.go:81\"\r\nDEBU[0012] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.12\"  source=\"collector.go:71\"\r\nDEBU[0014] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.12\" completed in 1.761167659s  source=\"collector.go:81\"\r\nDEBU[0014] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.2\"  source=\"collector.go:71\"\r\nDEBU[0014] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.2\" completed in 258.126994ms  source=\"collector.go:81\"\r\nDEBU[0014] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.3\"  source=\"collector.go:71\"\r\nDEBU[0015] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.3\" completed in 208.890762ms  source=\"collector.go:81\"\r\nDEBU[0015] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.4\"  source=\"collector.go:71\"\r\nDEBU[0015] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.4\" completed in 200.725047ms  source=\"collector.go:81\"\r\nDEBU[0015] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.7.2\"  source=\"collector.go:71\"\r\nDEBU[0015] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.7.2\" completed in 210.340754ms  source=\"collector.go:81\"\r\nDEBU[0015] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.8.1\"  source=\"collector.go:71\"\r\nDEBU[0015] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.1.8.1\" completed in 208.660179ms  source=\"collector.go:81\"\r\nDEBU[0015] Walking target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.10.2.3.2\"  source=\"collector.go:71\"\r\nDEBU[0017] Walk of target \"myswitch\" subtree \"1.3.6.1.4.1.318.1.1.10.2.3.2\" completed in 1.837394887s  source=\"collector.go:81\"\r\nDEBU[0017] Scrape of target 'myswitch' with module 'apcups' took 13.744268 seconds  source=\"main.go:84\"\r\n```\r\nI also checked this with snmpgetnext:\r\n```\r\nsnmpgetnext -v1 -c **** myswitch 1.3.6.1.2.1.1.3\r\nDISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1544804639) 178 days, 19:07:26.39\r\n```\r\n\r\nAfterwards I disabled SNMP v1 and run this again with only snmp v2 activated on target switch:\r\n```\r\ncurl \"http://myhost:9116/snmp?target=myswitch&module=apcups\"\r\nAn error has occurred during metrics gathering:\r\n\r\nerror collecting metric Desc{fqName: \"snmp_error\", help: \"Error scraping target\", constLabels: {}, variableLabels: []}: Error walking target myswitch: Request timeout (after 1 retries)\r\n```\r\nDebug output:\r\n```\r\nDEBU[0158] Scraping target 'myswitch' with module 'apcups'  source=\"main.go:73\"\r\nDEBU[0158] Walking target \"myswitch\" subtree \"1.3.6.1.2.1.1.3\"  source=\"collector.go:71\"\r\nINFO[0188] Error scraping target myswitch: Error walking target myswitch: Request timeout (after 1 retries)  source=\"collector.go:126\"\r\nDEBU[0188] Scrape of target 'myswitch' with module 'apcups' took 30.000693 seconds  source=\"main.go:84\"\r\n```\r\nChecked again with snmpgetnext. As expected, it doesn't wok with v1.\r\n```\r\nsnmpgetnext -v1 -c **** myswitch 1.3.6.1.2.1.1.3\r\nTimeout: No Response from myswitch.\r\n```\r\nHowever, with v2 it still work:\r\n```\r\n# snmpbulkget -v2c -c **** myswitch 1.3.6.1.2.1.1.3\r\nDISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1544926338) 178 days, 19:27:43.38\r\nSNMPv2-MIB::sysContact.0 = STRING: ****\r\nSNMPv2-MIB::sysName.0 = STRING: myswitch\r\nSNMPv2-MIB::sysLocation.0 = STRING: ****\r\nSNMPv2-MIB::sysServices.0 = INTEGER: 6\r\nSNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00\r\nSNMPv2-MIB::sysORID.1 = OID: SNMPv2-SMI::enterprises.9.7.129\r\nSNMPv2-MIB::sysORID.2 = OID: SNMPv2-SMI::enterprises.9.7.115\r\nSNMPv2-MIB::sysORID.3 = OID: SNMPv2-SMI::enterprises.9.7.265\r\nSNMPv2-MIB::sysORID.4 = OID: SNMPv2-SMI::enterprises.9.7.112\r\n```\r\n\r\n#### What did you expect to see?\r\nThe snmp_exporter use SNMP v2 and can fetch the metrics.\r\n\r\n#### What did you see instead?\r\nWe get a timeout and can't fetch any metrics anymore. It seems to us that the snmp_exporter continues to use SNMP v1 instead of v2."},"comment":{"url":"https://api.github.com/repos/prometheus/snmp_exporter/issues/comments/366244132","html_url":"https://github.com/prometheus/snmp_exporter/issues/266#issuecomment-366244132","issue_url":"https://api.github.com/repos/prometheus/snmp_exporter/issues/266","id":366244132,"user":{"login":"brian-brazil","id":7115638,"avatar_url":"https://avatars0.githubusercontent.com/u/7115638?v=4","gravatar_id":"","url":"https://api.github.com/users/brian-brazil","html_url":"https://github.com/brian-brazil","followers_url":"https://api.github.com/users/brian-brazil/followers","following_url":"https://api.github.com/users/brian-brazil/following{/other_user}","gists_url":"https://api.github.com/users/brian-brazil/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-brazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-brazil/subscriptions","organizations_url":"https://api.github.com/users/brian-brazil/orgs","repos_url":"https://api.github.com/users/brian-brazil/repos","events_url":"https://api.github.com/users/brian-brazil/events{/privacy}","received_events_url":"https://api.github.com/users/brian-brazil/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T14:06:47Z","updated_at":"2018-02-16T14:06:47Z","author_association":"OWNER","body":"Are you sure you haven't specified `  version: 1` in your module? That's the only way GETNEXT should be used."}}
{"actor":{"display_login":"brian-brazil"}}