{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/48058489","id":48058489,"diff_hunk":"@@ -0,0 +1,39 @@\n+# project\n+from checks import AgentCheck\n+import re\n+import subprocess\n+\n+dt_status = re.compile(\".*: (down|up) \\(pid (\\d+)\\) (\\d+) seconds\")\n+\n+class DaemonToolsCheck(AgentCheck):\n+    def check(self, instance):\n+        path = self.init_config.get('path', '/etc/service')\n+        service = instance.get('service')\n+        tags = instance.get('tags', [])\n+        tags.append(\"service:\" + service)\n+\n+        try:\n+            status = subprocess.Popen(['svstat', path + \"/\" + service], stdout=subprocess.PIPE, close_fds=True).communicate()[0]\n+\n+            check_message = status","path":"checks.d/daemontools.py","position":18,"original_position":18,"commit_id":"376f12edfa18f7bcc0ecf44acb66b0da2e7305cd","original_commit_id":"376f12edfa18f7bcc0ecf44acb66b0da2e7305cd","user":{"login":"remh","id":1311477,"avatar_url":"https://avatars.githubusercontent.com/u/1311477?v=3","gravatar_id":"","url":"https://api.github.com/users/remh","html_url":"https://github.com/remh","followers_url":"https://api.github.com/users/remh/followers","following_url":"https://api.github.com/users/remh/following{/other_user}","gists_url":"https://api.github.com/users/remh/gists{/gist_id}","starred_url":"https://api.github.com/users/remh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remh/subscriptions","organizations_url":"https://api.github.com/users/remh/orgs","repos_url":"https://api.github.com/users/remh/repos","events_url":"https://api.github.com/users/remh/events{/privacy}","received_events_url":"https://api.github.com/users/remh/received_events","type":"User","site_admin":false},"body":"I'm not sure why you need 2 variables for the same thing.","created_at":"2015-12-18T19:12:20Z","updated_at":"2015-12-18T19:12:20Z","html_url":"https://github.com/DataDog/dd-agent/pull/2110#discussion_r48058489","pull_request_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/comments/48058489"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/2110#discussion_r48058489"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110","id":52174428,"html_url":"https://github.com/DataDog/dd-agent/pull/2110","diff_url":"https://github.com/DataDog/dd-agent/pull/2110.diff","patch_url":"https://github.com/DataDog/dd-agent/pull/2110.patch","issue_url":"https://api.github.com/repos/DataDog/dd-agent/issues/2110","number":2110,"state":"open","locked":false,"title":"Daemontools integration.","user":{"login":"gphat","id":45159,"avatar_url":"https://avatars.githubusercontent.com/u/45159?v=3","gravatar_id":"","url":"https://api.github.com/users/gphat","html_url":"https://github.com/gphat","followers_url":"https://api.github.com/users/gphat/followers","following_url":"https://api.github.com/users/gphat/following{/other_user}","gists_url":"https://api.github.com/users/gphat/gists{/gist_id}","starred_url":"https://api.github.com/users/gphat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gphat/subscriptions","organizations_url":"https://api.github.com/users/gphat/orgs","repos_url":"https://api.github.com/users/gphat/repos","events_url":"https://api.github.com/users/gphat/events{/privacy}","received_events_url":"https://api.github.com/users/gphat/received_events","type":"User","site_admin":false},"body":"# What's this PR do?\r\n\r\nAdds an integration for the service manager [daemontools](http://cr.yp.to/daemontools.html).\r\n\r\n# Motivation\r\n\r\nStripe uses daemontools to manage most of our services. Many of those services have first-class integrations within Datadog so verifying their liveness is handled elsewhere. Some of these services, however, are lightweight, internal daemons that will likely never have healthcheck endpoints or other metrics. This check would allow liveness checks and uptime tracking. The goal is to detect failed or flapping services.\r\n\r\n# Notes\r\n\r\n* Adds a gauge metric for `daemontools.service.uptime` (tagged with the service name) and a service check of `daemontools.$service.is_running`.\r\n* `svstat` that emits the info we need usually requires root privs, so this integration needs some love from `sudoers`. This miiiight be a candidate for storage in [our repository](https://github.com/stripe/stripe-datadog-checks)?","created_at":"2015-11-30T20:26:31Z","updated_at":"2015-12-18T19:12:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e748eed63c575bdc2f0dbcc62817bf13488f64d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110/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/2110/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-agent/statuses/376f12edfa18f7bcc0ecf44acb66b0da2e7305cd","head":{"label":"gphat:add-daemontools-integration","ref":"add-daemontools-integration","sha":"376f12edfa18f7bcc0ecf44acb66b0da2e7305cd","user":{"login":"gphat","id":45159,"avatar_url":"https://avatars.githubusercontent.com/u/45159?v=3","gravatar_id":"","url":"https://api.github.com/users/gphat","html_url":"https://github.com/gphat","followers_url":"https://api.github.com/users/gphat/followers","following_url":"https://api.github.com/users/gphat/following{/other_user}","gists_url":"https://api.github.com/users/gphat/gists{/gist_id}","starred_url":"https://api.github.com/users/gphat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gphat/subscriptions","organizations_url":"https://api.github.com/users/gphat/orgs","repos_url":"https://api.github.com/users/gphat/repos","events_url":"https://api.github.com/users/gphat/events{/privacy}","received_events_url":"https://api.github.com/users/gphat/received_events","type":"User","site_admin":false},"repo":{"id":29254253,"name":"dd-agent","full_name":"gphat/dd-agent","owner":{"login":"gphat","id":45159,"avatar_url":"https://avatars.githubusercontent.com/u/45159?v=3","gravatar_id":"","url":"https://api.github.com/users/gphat","html_url":"https://github.com/gphat","followers_url":"https://api.github.com/users/gphat/followers","following_url":"https://api.github.com/users/gphat/following{/other_user}","gists_url":"https://api.github.com/users/gphat/gists{/gist_id}","starred_url":"https://api.github.com/users/gphat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gphat/subscriptions","organizations_url":"https://api.github.com/users/gphat/orgs","repos_url":"https://api.github.com/users/gphat/repos","events_url":"https://api.github.com/users/gphat/events{/privacy}","received_events_url":"https://api.github.com/users/gphat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gphat/dd-agent","description":"Datadog Agent","fork":true,"url":"https://api.github.com/repos/gphat/dd-agent","forks_url":"https://api.github.com/repos/gphat/dd-agent/forks","keys_url":"https://api.github.com/repos/gphat/dd-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gphat/dd-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gphat/dd-agent/teams","hooks_url":"https://api.github.com/repos/gphat/dd-agent/hooks","issue_events_url":"https://api.github.com/repos/gphat/dd-agent/issues/events{/number}","events_url":"https://api.github.com/repos/gphat/dd-agent/events","assignees_url":"https://api.github.com/repos/gphat/dd-agent/assignees{/user}","branches_url":"https://api.github.com/repos/gphat/dd-agent/branches{/branch}","tags_url":"https://api.github.com/repos/gphat/dd-agent/tags","blobs_url":"https://api.github.com/repos/gphat/dd-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gphat/dd-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gphat/dd-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/gphat/dd-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gphat/dd-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/gphat/dd-agent/languages","stargazers_url":"https://api.github.com/repos/gphat/dd-agent/stargazers","contributors_url":"https://api.github.com/repos/gphat/dd-agent/contributors","subscribers_url":"https://api.github.com/repos/gphat/dd-agent/subscribers","subscription_url":"https://api.github.com/repos/gphat/dd-agent/subscription","commits_url":"https://api.github.com/repos/gphat/dd-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/gphat/dd-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/gphat/dd-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/gphat/dd-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/gphat/dd-agent/contents/{+path}","compare_url":"https://api.github.com/repos/gphat/dd-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gphat/dd-agent/merges","archive_url":"https://api.github.com/repos/gphat/dd-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gphat/dd-agent/downloads","issues_url":"https://api.github.com/repos/gphat/dd-agent/issues{/number}","pulls_url":"https://api.github.com/repos/gphat/dd-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/gphat/dd-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/gphat/dd-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gphat/dd-agent/labels{/name}","releases_url":"https://api.github.com/repos/gphat/dd-agent/releases{/id}","created_at":"2015-01-14T16:40:49Z","updated_at":"2015-01-14T16:40:51Z","pushed_at":"2015-12-10T01:05:00Z","git_url":"git://github.com/gphat/dd-agent.git","ssh_url":"git@github.com:gphat/dd-agent.git","clone_url":"https://github.com/gphat/dd-agent.git","svn_url":"https://github.com/gphat/dd-agent","homepage":"http://docs.datadoghq.com/","size":30191,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"9cb6a51152ebbb3be48e49db2bbcfe10325d7aa2","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-12-18T03:13:14Z","pushed_at":"2015-12-18T19:02:34Z","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":32810,"stargazers_count":389,"watchers_count":389,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":360,"mirror_url":null,"open_issues_count":209,"forks":360,"open_issues":209,"watchers":389,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110"},"html":{"href":"https://github.com/DataDog/dd-agent/pull/2110"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/2110"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/issues/2110/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-agent/pulls/2110/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/2110/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-agent/statuses/376f12edfa18f7bcc0ecf44acb66b0da2e7305cd"}}}}