{"action":"created","issue":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/issues/7","labels_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/issues/7/comments","events_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/issues/7/events","html_url":"https://github.com/sensu-plugins/sensu-plugins-mysql/pull/7","id":104238084,"number":7,"title":"Added socket section to ini file - alive + graphite","user":{"login":"hanynowsky","id":1187728,"avatar_url":"https://avatars.githubusercontent.com/u/1187728?v=3","gravatar_id":"","url":"https://api.github.com/users/hanynowsky","html_url":"https://github.com/hanynowsky","followers_url":"https://api.github.com/users/hanynowsky/followers","following_url":"https://api.github.com/users/hanynowsky/following{/other_user}","gists_url":"https://api.github.com/users/hanynowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/hanynowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanynowsky/subscriptions","organizations_url":"https://api.github.com/users/hanynowsky/orgs","repos_url":"https://api.github.com/users/hanynowsky/repos","events_url":"https://api.github.com/users/hanynowsky/events{/privacy}","received_events_url":"https://api.github.com/users/hanynowsky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/labels/Feedback%20Requested","name":"Feedback Requested","color":"fbca04"},{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/labels/Needs%20Review","name":"Needs Review","color":"005200"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-01T10:41:11Z","updated_at":"2015-09-29T21:06:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/pulls/7","html_url":"https://github.com/sensu-plugins/sensu-plugins-mysql/pull/7","diff_url":"https://github.com/sensu-plugins/sensu-plugins-mysql/pull/7.diff","patch_url":"https://github.com/sensu-plugins/sensu-plugins-mysql/pull/7.patch"},"body":"we populate the /etc/sensu/my.cnf with MySQL user and pass. But usually we need to point the path of used MySQL socket which is not always /var/lib/mysql/mysql.sock\r\n- Thus, enabling socket param in /etc/sensu/my.cnf is the best option (Since using --socket option from sensu server is impossible when differents clients have different mysql paths):\r\nJust this would do:\r\n\r\n```ruby\r\n\r\ndef run\r\n    if config[:ini]\r\n      ini = IniFile.load(config[:ini])\r\n      section = ini['client']\r\n      db_user = section['user']\r\n      db_pass = section['password']\r\n      db_socket = section['socket']\r\n    else\r\n      db_user = config[:user]\r\n      db_pass = config[:password]\r\n      db_socket = config[:socket]\r\n    end\r\n\r\n    begin\r\n      db = Mysql.real_connect(config[:hostname], db_user, db_pass, config[:database], config[:port].to_i, db_socket)\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/issues/comments/144191648","html_url":"https://github.com/sensu-plugins/sensu-plugins-mysql/pull/7#issuecomment-144191648","issue_url":"https://api.github.com/repos/sensu-plugins/sensu-plugins-mysql/issues/7","id":144191648,"user":{"login":"analytically","id":254434,"avatar_url":"https://avatars.githubusercontent.com/u/254434?v=3","gravatar_id":"","url":"https://api.github.com/users/analytically","html_url":"https://github.com/analytically","followers_url":"https://api.github.com/users/analytically/followers","following_url":"https://api.github.com/users/analytically/following{/other_user}","gists_url":"https://api.github.com/users/analytically/gists{/gist_id}","starred_url":"https://api.github.com/users/analytically/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/analytically/subscriptions","organizations_url":"https://api.github.com/users/analytically/orgs","repos_url":"https://api.github.com/users/analytically/repos","events_url":"https://api.github.com/users/analytically/events{/privacy}","received_events_url":"https://api.github.com/users/analytically/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T21:06:47Z","updated_at":"2015-09-29T21:06:47Z","body":"Can you fix this PR or open a new one?"}}