{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/1389","repository_url":"https://api.github.com/repos/influxdata/telegraf","labels_url":"https://api.github.com/repos/influxdata/telegraf/issues/1389/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/1389/comments","events_url":"https://api.github.com/repos/influxdata/telegraf/issues/1389/events","html_url":"https://github.com/influxdata/telegraf/pull/1389","id":161121011,"number":1389,"title":"Alternate SNMP plugin","user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":52,"created_at":"2016-06-20T05:45:56Z","updated_at":"2016-08-21T05:30:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/influxdata/telegraf/pulls/1389","html_url":"https://github.com/influxdata/telegraf/pull/1389","diff_url":"https://github.com/influxdata/telegraf/pull/1389.diff","patch_url":"https://github.com/influxdata/telegraf/pull/1389.patch"},"body":"This is a proposal for an alternate SNMP plugin.\r\n\r\nI wrote this because of issues like #1371, #808 & #1361\r\nI also found the configuration of the existing SNMP plugin to be overly complex & confusing.\r\n\r\nThis new plugin has:\r\n* A vastly simpler config\r\n* Supports SNMP tables properly (#1371 & #808)\r\n* Supports converting strings to numeric types (#1361 & #1151)\r\n* Supports adding tags using SNMP values (#997)\r\n* Supports SNMP v1 (#1163) & v3 (#856)\r\n* Does not require an external file (`snmptranslate_file`)\r\n* Should also fix #1043 & #961 \r\n\r\n### Example usage:\r\n\r\nSNMP data:\r\n```\r\n.1.2.3.0.0.1.0 octet_str \"foo\"\r\n.1.2.3.0.0.1.1 octet_str \"bar\"\r\n.1.2.3.0.0.102 octet_str \"bad\"\r\n.1.2.3.0.0.2.0 uinteger 1\r\n.1.2.3.0.0.2.1 uinteger 2\r\n.1.2.3.0.0.3.0 octet_str \"0.123\"\r\n.1.2.3.0.0.3.1 octet_str \"0.456\"\r\n.1.2.3.0.0.3.2 octet_str \"9.999\"\r\n.1.2.3.0.1 octet_str \"baz\"\r\n.1.2.3.0.2 integer 234\r\n```\r\n\r\nConfig:\r\n```\r\n[[inputs.snmp2]]\r\n\turis = [ \"snmp2c://localhost:1161\" ]\r\n\r\n\tname = \"normalvalues\"\r\n\t[[inputs.snmp2.field]]\r\n\t\tname = \"hostname\"\r\n\t\tis_tag = true\r\n\t\toid = \".1.2.3.0.1\"\r\n\t[[inputs.snmp2.field]]\r\n\t\tname = \"loadavg\"\r\n\t\toid = \".1.2.3.0.2\"\r\n\t\tconversion = \"float(2)\" # converts 123 to 1.23\r\n\r\n\t[[inputs.snmp2.table]]\r\n\t\tname = \"mytable\"\r\n\t\tinherit_tags = [\"hostname\"]\r\n\t\t[[inputs.snmp2.table.field]]\r\n\t\t\tname = \"tablefield1\"\r\n\t\t\toid = \".1.2.3.0.0.1\"\r\n\t\t\tis_tag = true\r\n\t\t[[inputs.snmp2.table.field]]\r\n\t\t\tname = \"tablefield2\"\r\n\t\t\toid = \".1.2.3.0.0.2\"\r\n\t\t[[inputs.snmp2.table.field]]\r\n\t\t\tname = \"tablefield3\"\r\n\t\t\toid = \".1.2.3.0.0.3\"\r\n\t\t\tconversion = \"float\" # converts \"0.123\" to 0.123\r\n```\r\n\r\nOutput:\r\n```\r\n* Plugin: snmp2, Collection 1\r\n> normalvalues,agent_host=localhost,host=myhost,hostname=baz loadavg=2.34 1466400920000000000\r\n> mytable,agent_host=localhost,host=myhost,hostname=baz,tablefield1=bar tablefield2=2i,tablefield3=0.456 1466400920000000000\r\n> mytable,agent_host=localhost,host=myhost,hostname=baz,tablefield1=foo tablefield2=1i,tablefield3=0.123 1466400920000000000\r\n```\r\n\r\n### Direction\r\nThe PR is incomplete. I wasn't sure if this would be accepted at all, and if it was, should it replace the existing SNMP plugin, or go in as an alternate plugin.\r\nDepending on the responses, I can clean up the code a little bit, add more documentation, more tests, and take care of the other stuff like changelog & readme.\r\n\r\n### Required for all PRs:\r\n\r\n- [ ] CHANGELOG.md updated\r\n- [X] Sign [CLA](https://influxdata.com/community/cla/) (if not already signed)\r\n- [ ] README.md updated (if adding a new plugin)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/comments/241239908","html_url":"https://github.com/influxdata/telegraf/pull/1389#issuecomment-241239908","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/1389","id":241239908,"user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"created_at":"2016-08-21T05:30:17Z","updated_at":"2016-08-21T05:30:17Z","body":"> there appears to be a data race in the code (or possibly just in the test code)\r\n\r\nWas just the test code. But I fixed it."}}
{"actor":{"display_login":"phemmer"}}