{"action":"created","comment":{"url":"https://api.github.com/repos/StackVista/sts-agent/pulls/comments/104914749","pull_request_review_id":25769761,"id":104914749,"diff_hunk":"@@ -0,0 +1,190 @@\n+\"\"\"\n+    StackState.\n+    Splunk topology extraction\n+\"\"\"\n+\n+# 3rd party\n+import requests\n+from urllib import quote\n+import time\n+\n+# project\n+from checks import AgentCheck, CheckException\n+\n+\n+class SavedSearch:\n+    def __init__(self, saved_search):\n+        self.name = saved_search['name']\n+        self.element_type = saved_search['element_type']\n+        self.parameters = saved_search['parameters']\n+\n+\n+class InstanceConfig:\n+    def __init__(self, instance, init_config):\n+        default_timeout = init_config.get('default_timeout', 5)\n+        max_retry_count = init_config.get('max_retry_count', 3)\n+        seconds_between_retries = init_config.get('seconds_between_retries', 1)\n+        polling_interval = init_config.get('polling_interval', 15)\n+\n+        self.base_url = instance['url']\n+        self.username = instance['username']\n+        self.password = instance['password']\n+        self.timeout = float(instance.get('timeout', default_timeout))","path":"checks.d/splunk_topology.py","position":32,"original_position":32,"commit_id":"ff26c37c61fcdfa703c22b81320392755761f7d6","original_commit_id":"5c423aa0f61a48edea4f86db590af5164d25c1f2","user":{"login":"whazenberg","id":3426800,"avatar_url":"https://avatars1.githubusercontent.com/u/3426800?v=3","gravatar_id":"","url":"https://api.github.com/users/whazenberg","html_url":"https://github.com/whazenberg","followers_url":"https://api.github.com/users/whazenberg/followers","following_url":"https://api.github.com/users/whazenberg/following{/other_user}","gists_url":"https://api.github.com/users/whazenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/whazenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whazenberg/subscriptions","organizations_url":"https://api.github.com/users/whazenberg/orgs","repos_url":"https://api.github.com/users/whazenberg/repos","events_url":"https://api.github.com/users/whazenberg/events{/privacy}","received_events_url":"https://api.github.com/users/whazenberg/received_events","type":"User","site_admin":false},"body":"I've added some comments in the config file and changed the name a bit.\r\nRegarding the 'global' timeout, I would like that, however the script is single threaded; you block for a http request before being able to check for this global timeout possibly incurring more wait time before actually timing out (overhead of max request timeout). Some explaining is then needed for the two different timeouts if we go that route. Let's discuss furher tomorrow.","created_at":"2017-03-08T13:22:18Z","updated_at":"2017-03-08T13:22:19Z","html_url":"https://github.com/StackVista/sts-agent/pull/19#discussion_r104914749","pull_request_url":"https://api.github.com/repos/StackVista/sts-agent/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/StackVista/sts-agent/pulls/comments/104914749"},"html":{"href":"https://github.com/StackVista/sts-agent/pull/19#discussion_r104914749"},"pull_request":{"href":"https://api.github.com/repos/StackVista/sts-agent/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/StackVista/sts-agent/pulls/19","id":109470069,"html_url":"https://github.com/StackVista/sts-agent/pull/19","diff_url":"https://github.com/StackVista/sts-agent/pull/19.diff","patch_url":"https://github.com/StackVista/sts-agent/pull/19.patch","issue_url":"https://api.github.com/repos/StackVista/sts-agent/issues/19","number":19,"state":"open","locked":false,"title":"Splunk topology","user":{"login":"craffit","id":10679,"avatar_url":"https://avatars1.githubusercontent.com/u/10679?v=3","gravatar_id":"","url":"https://api.github.com/users/craffit","html_url":"https://github.com/craffit","followers_url":"https://api.github.com/users/craffit/followers","following_url":"https://api.github.com/users/craffit/following{/other_user}","gists_url":"https://api.github.com/users/craffit/gists{/gist_id}","starred_url":"https://api.github.com/users/craffit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craffit/subscriptions","organizations_url":"https://api.github.com/users/craffit/orgs","repos_url":"https://api.github.com/users/craffit/repos","events_url":"https://api.github.com/users/craffit/events{/privacy}","received_events_url":"https://api.github.com/users/craffit/received_events","type":"User","site_admin":false},"body":"- Added check to gather topology data from splunk","created_at":"2017-03-07T12:35:41Z","updated_at":"2017-03-08T13:22:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64b4d007c1c34b88e4bb45289dbf5760bb92c1c3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/StackVista/sts-agent/pulls/19/commits","review_comments_url":"https://api.github.com/repos/StackVista/sts-agent/pulls/19/comments","review_comment_url":"https://api.github.com/repos/StackVista/sts-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/StackVista/sts-agent/issues/19/comments","statuses_url":"https://api.github.com/repos/StackVista/sts-agent/statuses/ff26c37c61fcdfa703c22b81320392755761f7d6","head":{"label":"StackVista:splunk_topology","ref":"splunk_topology","sha":"ff26c37c61fcdfa703c22b81320392755761f7d6","user":{"login":"StackVista","id":10511829,"avatar_url":"https://avatars0.githubusercontent.com/u/10511829?v=3","gravatar_id":"","url":"https://api.github.com/users/StackVista","html_url":"https://github.com/StackVista","followers_url":"https://api.github.com/users/StackVista/followers","following_url":"https://api.github.com/users/StackVista/following{/other_user}","gists_url":"https://api.github.com/users/StackVista/gists{/gist_id}","starred_url":"https://api.github.com/users/StackVista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackVista/subscriptions","organizations_url":"https://api.github.com/users/StackVista/orgs","repos_url":"https://api.github.com/users/StackVista/repos","events_url":"https://api.github.com/users/StackVista/events{/privacy}","received_events_url":"https://api.github.com/users/StackVista/received_events","type":"Organization","site_admin":false},"repo":{"id":61370636,"name":"sts-agent","full_name":"StackVista/sts-agent","owner":{"login":"StackVista","id":10511829,"avatar_url":"https://avatars0.githubusercontent.com/u/10511829?v=3","gravatar_id":"","url":"https://api.github.com/users/StackVista","html_url":"https://github.com/StackVista","followers_url":"https://api.github.com/users/StackVista/followers","following_url":"https://api.github.com/users/StackVista/following{/other_user}","gists_url":"https://api.github.com/users/StackVista/gists{/gist_id}","starred_url":"https://api.github.com/users/StackVista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackVista/subscriptions","organizations_url":"https://api.github.com/users/StackVista/orgs","repos_url":"https://api.github.com/users/StackVista/repos","events_url":"https://api.github.com/users/StackVista/events{/privacy}","received_events_url":"https://api.github.com/users/StackVista/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackVista/sts-agent","description":null,"fork":false,"url":"https://api.github.com/repos/StackVista/sts-agent","forks_url":"https://api.github.com/repos/StackVista/sts-agent/forks","keys_url":"https://api.github.com/repos/StackVista/sts-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackVista/sts-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackVista/sts-agent/teams","hooks_url":"https://api.github.com/repos/StackVista/sts-agent/hooks","issue_events_url":"https://api.github.com/repos/StackVista/sts-agent/issues/events{/number}","events_url":"https://api.github.com/repos/StackVista/sts-agent/events","assignees_url":"https://api.github.com/repos/StackVista/sts-agent/assignees{/user}","branches_url":"https://api.github.com/repos/StackVista/sts-agent/branches{/branch}","tags_url":"https://api.github.com/repos/StackVista/sts-agent/tags","blobs_url":"https://api.github.com/repos/StackVista/sts-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackVista/sts-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackVista/sts-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackVista/sts-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackVista/sts-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/StackVista/sts-agent/languages","stargazers_url":"https://api.github.com/repos/StackVista/sts-agent/stargazers","contributors_url":"https://api.github.com/repos/StackVista/sts-agent/contributors","subscribers_url":"https://api.github.com/repos/StackVista/sts-agent/subscribers","subscription_url":"https://api.github.com/repos/StackVista/sts-agent/subscription","commits_url":"https://api.github.com/repos/StackVista/sts-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackVista/sts-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackVista/sts-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackVista/sts-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackVista/sts-agent/contents/{+path}","compare_url":"https://api.github.com/repos/StackVista/sts-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackVista/sts-agent/merges","archive_url":"https://api.github.com/repos/StackVista/sts-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackVista/sts-agent/downloads","issues_url":"https://api.github.com/repos/StackVista/sts-agent/issues{/number}","pulls_url":"https://api.github.com/repos/StackVista/sts-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/StackVista/sts-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/StackVista/sts-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackVista/sts-agent/labels{/name}","releases_url":"https://api.github.com/repos/StackVista/sts-agent/releases{/id}","deployments_url":"https://api.github.com/repos/StackVista/sts-agent/deployments","created_at":"2016-06-17T12:01:24Z","updated_at":"2016-11-25T10:13:25Z","pushed_at":"2017-03-08T13:06:00Z","git_url":"git://github.com/StackVista/sts-agent.git","ssh_url":"git@github.com:StackVista/sts-agent.git","clone_url":"https://github.com/StackVista/sts-agent.git","svn_url":"https://github.com/StackVista/sts-agent","homepage":null,"size":34692,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"StackVista:master","ref":"master","sha":"75a778c24db9248c17fd3d162b0c2b3f58dd4207","user":{"login":"StackVista","id":10511829,"avatar_url":"https://avatars0.githubusercontent.com/u/10511829?v=3","gravatar_id":"","url":"https://api.github.com/users/StackVista","html_url":"https://github.com/StackVista","followers_url":"https://api.github.com/users/StackVista/followers","following_url":"https://api.github.com/users/StackVista/following{/other_user}","gists_url":"https://api.github.com/users/StackVista/gists{/gist_id}","starred_url":"https://api.github.com/users/StackVista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackVista/subscriptions","organizations_url":"https://api.github.com/users/StackVista/orgs","repos_url":"https://api.github.com/users/StackVista/repos","events_url":"https://api.github.com/users/StackVista/events{/privacy}","received_events_url":"https://api.github.com/users/StackVista/received_events","type":"Organization","site_admin":false},"repo":{"id":61370636,"name":"sts-agent","full_name":"StackVista/sts-agent","owner":{"login":"StackVista","id":10511829,"avatar_url":"https://avatars0.githubusercontent.com/u/10511829?v=3","gravatar_id":"","url":"https://api.github.com/users/StackVista","html_url":"https://github.com/StackVista","followers_url":"https://api.github.com/users/StackVista/followers","following_url":"https://api.github.com/users/StackVista/following{/other_user}","gists_url":"https://api.github.com/users/StackVista/gists{/gist_id}","starred_url":"https://api.github.com/users/StackVista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StackVista/subscriptions","organizations_url":"https://api.github.com/users/StackVista/orgs","repos_url":"https://api.github.com/users/StackVista/repos","events_url":"https://api.github.com/users/StackVista/events{/privacy}","received_events_url":"https://api.github.com/users/StackVista/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/StackVista/sts-agent","description":null,"fork":false,"url":"https://api.github.com/repos/StackVista/sts-agent","forks_url":"https://api.github.com/repos/StackVista/sts-agent/forks","keys_url":"https://api.github.com/repos/StackVista/sts-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StackVista/sts-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StackVista/sts-agent/teams","hooks_url":"https://api.github.com/repos/StackVista/sts-agent/hooks","issue_events_url":"https://api.github.com/repos/StackVista/sts-agent/issues/events{/number}","events_url":"https://api.github.com/repos/StackVista/sts-agent/events","assignees_url":"https://api.github.com/repos/StackVista/sts-agent/assignees{/user}","branches_url":"https://api.github.com/repos/StackVista/sts-agent/branches{/branch}","tags_url":"https://api.github.com/repos/StackVista/sts-agent/tags","blobs_url":"https://api.github.com/repos/StackVista/sts-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StackVista/sts-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StackVista/sts-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/StackVista/sts-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StackVista/sts-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/StackVista/sts-agent/languages","stargazers_url":"https://api.github.com/repos/StackVista/sts-agent/stargazers","contributors_url":"https://api.github.com/repos/StackVista/sts-agent/contributors","subscribers_url":"https://api.github.com/repos/StackVista/sts-agent/subscribers","subscription_url":"https://api.github.com/repos/StackVista/sts-agent/subscription","commits_url":"https://api.github.com/repos/StackVista/sts-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/StackVista/sts-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/StackVista/sts-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/StackVista/sts-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/StackVista/sts-agent/contents/{+path}","compare_url":"https://api.github.com/repos/StackVista/sts-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StackVista/sts-agent/merges","archive_url":"https://api.github.com/repos/StackVista/sts-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StackVista/sts-agent/downloads","issues_url":"https://api.github.com/repos/StackVista/sts-agent/issues{/number}","pulls_url":"https://api.github.com/repos/StackVista/sts-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/StackVista/sts-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/StackVista/sts-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StackVista/sts-agent/labels{/name}","releases_url":"https://api.github.com/repos/StackVista/sts-agent/releases{/id}","deployments_url":"https://api.github.com/repos/StackVista/sts-agent/deployments","created_at":"2016-06-17T12:01:24Z","updated_at":"2016-11-25T10:13:25Z","pushed_at":"2017-03-08T13:06:00Z","git_url":"git://github.com/StackVista/sts-agent.git","ssh_url":"git@github.com:StackVista/sts-agent.git","clone_url":"https://github.com/StackVista/sts-agent.git","svn_url":"https://github.com/StackVista/sts-agent","homepage":null,"size":34692,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/StackVista/sts-agent/pulls/19"},"html":{"href":"https://github.com/StackVista/sts-agent/pull/19"},"issue":{"href":"https://api.github.com/repos/StackVista/sts-agent/issues/19"},"comments":{"href":"https://api.github.com/repos/StackVista/sts-agent/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/StackVista/sts-agent/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/StackVista/sts-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/StackVista/sts-agent/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/StackVista/sts-agent/statuses/ff26c37c61fcdfa703c22b81320392755761f7d6"}}}}
{"actor":{"display_login":"whazenberg"}}