{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/33486817","id":33486817,"diff_hunk":"@@ -257,16 +295,26 @@ def _strip_password(self, file_path):\n         return temp_path, password_found\n \n     # Add output of the command to the tarfile\n-    def _add_command_output_tar(self, name, command):\n-        temp_path = os.path.join(tempfile.gettempdir(), name)\n+    def _add_command_output_tar(self, name, command, logger_name=None):\n+        temp_path = os.path.join(tempfile.gettempdir(), name.replace(os.sep, '__'))","path":"utils/flare.py","position":103,"original_position":103,"commit_id":"b507c0b489b98addf3e56b2e8ac2f768922d9b68","original_commit_id":"b507c0b489b98addf3e56b2e8ac2f768922d9b68","user":{"login":"degemer","id":4912048,"avatar_url":"https://avatars.githubusercontent.com/u/4912048?v=3","gravatar_id":"","url":"https://api.github.com/users/degemer","html_url":"https://github.com/degemer","followers_url":"https://api.github.com/users/degemer/followers","following_url":"https://api.github.com/users/degemer/following{/other_user}","gists_url":"https://api.github.com/users/degemer/gists{/gist_id}","starred_url":"https://api.github.com/users/degemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degemer/subscriptions","organizations_url":"https://api.github.com/users/degemer/orgs","repos_url":"https://api.github.com/users/degemer/repos","events_url":"https://api.github.com/users/degemer/events{/privacy}","received_events_url":"https://api.github.com/users/degemer/received_events","type":"User","site_admin":false},"body":"I'm not a huge fan of this (especially just after a `os.path.join`, it's kind of redondant), maybe instead of using the `tempfile.gettempdir()` you could call https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp ? Or add a `subdir=` option. Or even easier a `temp_name=` option.","created_at":"2015-06-29T17:08:07Z","updated_at":"2015-06-29T17:08:07Z","html_url":"https://github.com/DataDog/dd-agent/pull/1726#discussion_r33486817","pull_request_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/33486817"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/1726#discussion_r33486817"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726","id":38564530,"html_url":"https://github.com/DataDog/dd-agent/pull/1726","diff_url":"https://github.com/DataDog/dd-agent/pull/1726.diff","patch_url":"https://github.com/DataDog/dd-agent/pull/1726.patch","issue_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1726","number":1726,"state":"open","locked":false,"title":"[flare] Add JMXFetch-specific info","user":{"login":"olivielpeau","id":4912500,"avatar_url":"https://avatars.githubusercontent.com/u/4912500?v=3","gravatar_id":"","url":"https://api.github.com/users/olivielpeau","html_url":"https://github.com/olivielpeau","followers_url":"https://api.github.com/users/olivielpeau/followers","following_url":"https://api.github.com/users/olivielpeau/following{/other_user}","gists_url":"https://api.github.com/users/olivielpeau/gists{/gist_id}","starred_url":"https://api.github.com/users/olivielpeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivielpeau/subscriptions","organizations_url":"https://api.github.com/users/olivielpeau/orgs","repos_url":"https://api.github.com/users/olivielpeau/repos","events_url":"https://api.github.com/users/olivielpeau/events{/privacy}","received_events_url":"https://api.github.com/users/olivielpeau/received_events","type":"User","site_admin":false},"body":"Adds in a `jmxinfo` directory:\r\n\r\n- 2 JMXFetch status files: `jmx_status.yaml` and `jmx_status_python.yaml`\r\n- JMXfetch commands output: `list_matching_attributes` and `list_everything`\r\n- `java -version` output (using the configured java path) in a `java_version.log` file\r\n\r\n@remh One thing that may not work properly in flare is the change I've made here https://github.com/DataDog/dd-agent/compare/olivielpeau/jmx-flare?expand=1#diff-64a477c26f008c29252aad6c1499c099R271 , which basically leaves file descriptors open (`close_fds=False`) when the JMXFetch subprocess is launched from the flare command. Do you know what issues can happen when the main process leaves the file descriptors open ?\r\n\r\ncc @degemer @yannmh ","created_at":"2015-06-25T16:07:50Z","updated_at":"2015-06-29T17:08:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf7120f544d0ea7f605dfd4305f3646dcb592929","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726/comments","review_comment_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/issues/1726/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/b507c0b489b98addf3e56b2e8ac2f768922d9b68","head":{"label":"DataDog:olivielpeau/jmx-flare","ref":"olivielpeau/jmx-flare","sha":"b507c0b489b98addf3e56b2e8ac2f768922d9b68","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2015-06-27T22:10:10Z","pushed_at":"2015-06-29T16:03:52Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":50650,"stargazers_count":302,"watchers_count":302,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":231,"mirror_url":null,"open_issues_count":181,"forks":231,"open_issues":181,"watchers":302,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"d55444cc9417898534324d5ef2c897ab3e13ae78","user":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":1210071,"name":"dd-agent","full_name":"DataDog/dd-agent","owner":{"login":"DataDog","id":365230,"avatar_url":"https://avatars.githubusercontent.com/u/365230?v=3","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataDog/dd-agent","description":"Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/dd-agent","forks_url":"https://api.github.com/repos/DataDog/dd-agent/forks","keys_url":"https://api.github.com/repos/DataDog/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-agent/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-agent/events","assignees_url":"https://api.github.com/repos/DataDog/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-agent/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-agent/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-agent/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-agent/merges","archive_url":"https://api.github.com/repos/DataDog/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-agent/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-agent/releases{/id}","created_at":"2010-12-31T03:02:47Z","updated_at":"2015-06-27T22:10:10Z","pushed_at":"2015-06-29T16:03:52Z","git_url":"git://github.com/DataDog/dd-agent.git","ssh_url":"git@github.com:DataDog/dd-agent.git","clone_url":"https://github.com/DataDog/dd-agent.git","svn_url":"https://github.com/DataDog/dd-agent","homepage":"http://docs.datadoghq.com/","size":50650,"stargazers_count":302,"watchers_count":302,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":231,"mirror_url":null,"open_issues_count":181,"forks":231,"open_issues":181,"watchers":302,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/1726"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/1726"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/1726/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/1726/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-agent/statuses/b507c0b489b98addf3e56b2e8ac2f768922d9b68"}}}}