{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/2861","repository_url":"https://api.github.com/repos/influxdata/telegraf","labels_url":"https://api.github.com/repos/influxdata/telegraf/issues/2861/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/2861/comments","events_url":"https://api.github.com/repos/influxdata/telegraf/issues/2861/events","html_url":"https://github.com/influxdata/telegraf/issues/2861","id":231899143,"number":2861,"title":"azure issues with sqlserver","user":{"login":"regevbr","id":5775519,"avatar_url":"https://avatars1.githubusercontent.com/u/5775519?v=3","gravatar_id":"","url":"https://api.github.com/users/regevbr","html_url":"https://github.com/regevbr","followers_url":"https://api.github.com/users/regevbr/followers","following_url":"https://api.github.com/users/regevbr/following{/other_user}","gists_url":"https://api.github.com/users/regevbr/gists{/gist_id}","starred_url":"https://api.github.com/users/regevbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/regevbr/subscriptions","organizations_url":"https://api.github.com/users/regevbr/orgs","repos_url":"https://api.github.com/users/regevbr/repos","events_url":"https://api.github.com/users/regevbr/events{/privacy}","received_events_url":"https://api.github.com/users/regevbr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-28T22:25:52Z","updated_at":"2017-05-28T23:18:45Z","closed_at":null,"body":"## Bug report\r\n\r\n### Relevant telegraf.conf:\r\n```\r\n[[inputs.sqlserver]]\r\n  servers = [\r\n    \"Server=<Server>;Port=1433;User Id=<user>;Password=<password>;Encrypt=True;TrustServerCertificate=True;MultipleActiveResultSets=False;Persist Security Info=False;\",\r\n  ]\r\n```\r\n\r\n### System info:\r\n\r\ntelegraf 1.3.0 and telegraf 1.2.1\r\nUbuntu 16\r\n```\r\nselect @@Version\r\nMicrosoft SQL Azure (RTM) - 12.0.2000.8   Mar 21 2017 02:11:40   Copyright (C) 2016 Microsoft Corporation. All rights reserved. \r\n```\r\nAzure firewall set up correctly\r\n\r\n### Steps to reproduce:\r\n\r\nuse the provided conf in either version of telegraf along with azure sql server\r\n\r\n### Expected behavior:\r\n\r\nmetrics get sent\r\n\r\n### Actual behavior:\r\n\r\n```\r\n2017-05-28T21:44:00Z E! Error in plugin [inputs.sqlserver]: read tcp 10.0.0.8:59260-><ip>:11210: read: connection reset by peer\r\n2017-05-28T21:44:00Z E! Error in plugin [inputs.sqlserver]: driver: bad connection\r\n```\r\n\r\n### Additional info:\r\n\r\nUsing the same connection string in a simple go progeam:\r\n```\r\npackage main\r\n\r\nimport _ \"github.com/zensqlmonitor/go-mssqldb\"\r\nimport \"database/sql\"\r\nimport \"log\"\r\nimport \"fmt\"\r\n\r\nvar debug = true\r\n\r\nfunc main() {\r\n\r\n        connString :=  \"Server=<Server>;Port=1433;User Id=<user>;Password=<password>;Encrypt=True;TrustServerCertificate=True;MultipleActiveResultSets=False;Persist Security Info=False;\"\r\n        if debug {\r\n                fmt.Printf(\" connString:%s\\n\", connString)\r\n        }\r\n        conn, err := sql.Open(\"mssql\", connString)\r\n        if err != nil {\r\n                log.Fatal(\"Open connection failed:\", err.Error())\r\n        }\r\n        defer conn.Close()\r\n\r\n        stmt, err := conn.Prepare(\"select 1, 'abc'\")\r\n        if err != nil {\r\n                log.Fatal(\"Prepare failed:\", err.Error())\r\n        }\r\n        defer stmt.Close()\r\n\r\n        row := stmt.QueryRow()\r\n        var somenumber int64\r\n        var somechars string\r\n        err = row.Scan(&somenumber, &somechars)\r\n        if err != nil {\r\n                log.Fatal(\"Scan failed:\", err.Error())\r\n        }\r\n        fmt.Printf(\"somenumber:%d\\n\", somenumber)\r\n        fmt.Printf(\"somechars:%s\\n\", somechars)\r\n\r\n        fmt.Printf(\"bye\\n\")\r\n\r\n}\r\n```\r\nWith either  github.com/zensqlmonitor/go-mssqldb or github.com/denisenkom/go-mssqldb doesn't create any issuess...."},"comment":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/comments/304546667","html_url":"https://github.com/influxdata/telegraf/issues/2861#issuecomment-304546667","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/2861","id":304546667,"user":{"login":"kardianos","id":755121,"avatar_url":"https://avatars1.githubusercontent.com/u/755121?v=3","gravatar_id":"","url":"https://api.github.com/users/kardianos","html_url":"https://github.com/kardianos","followers_url":"https://api.github.com/users/kardianos/followers","following_url":"https://api.github.com/users/kardianos/following{/other_user}","gists_url":"https://api.github.com/users/kardianos/gists{/gist_id}","starred_url":"https://api.github.com/users/kardianos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kardianos/subscriptions","organizations_url":"https://api.github.com/users/kardianos/orgs","repos_url":"https://api.github.com/users/kardianos/repos","events_url":"https://api.github.com/users/kardianos/events{/privacy}","received_events_url":"https://api.github.com/users/kardianos/received_events","type":"User","site_admin":false},"created_at":"2017-05-28T23:18:45Z","updated_at":"2017-05-28T23:18:45Z","body":"For above, probably just check if they exist before querying, rather then new plugin."}}
{"actor":{"display_login":"kardianos"}}