{"action":"created","comment":{"url":"https://api.github.com/repos/gdnsd/gdnsd/pulls/comments/63868185","id":63868185,"diff_hunk":"@@ -363,14 +365,34 @@ void plugin_extmon_load_config(vscf_data_t* config, const unsigned num_threads V\n         helper_path = gdnsd_resolve_path_libexec(\"gdnsd_extmon_helper\", NULL);\n }\n \n+#define SVC_OPT_UINT(_hash, _typnam, _loc, _min, _max) \\\n+    do { \\\n+        vscf_data_t* _data = vscf_hash_get_data_byconstkey(_hash, #_loc, true); \\\n+        if(_data) { \\\n+            unsigned long _val; \\\n+            if(!vscf_is_simple(_data) \\\n+            || !vscf_simple_get_as_ulong(_data, &_val)) \\\n+                log_fatal(\"plugin_http_status: Service type '%s': option '%s': Value must be a positive integer\", _typnam, #_loc); \\\n+            if(_val < _min || _val > _max) \\\n+                log_fatal(\"plugin_http_status: Service type '%s': option '%s': Value out of range (%lu, %lu)\", _typnam, #_loc, _min, _max); \\\n+            _loc = (unsigned) _val; \\\n+        } \\\n+    } while(0)\n+\n void plugin_extmon_add_svctype(const char* name, vscf_data_t* svc_cfg, const unsigned interval, const unsigned timeout) {\n     dmn_assert(name); dmn_assert(svc_cfg);\n \n+    // defaults\n+    unsigned max_proc = 80;\n+\n+\n     svcs = xrealloc(svcs, (num_svcs + 1) * sizeof(svc_t));\n     svc_t* this_svc = &svcs[num_svcs++];\n     this_svc->name = strdup(name);\n     this_svc->timeout = timeout;\n     this_svc->interval = interval;\n+    SVC_OPT_UINT(svc_cfg, name, max_proc, 1LU, 65534LU);","path":"plugins/extmon.c","position":46,"original_position":46,"commit_id":"9f621ad2624707431d5dd8193ee2a1fe64552fa5","original_commit_id":"9f621ad2624707431d5dd8193ee2a1fe64552fa5","user":{"login":"blblack","id":1015349,"avatar_url":"https://avatars.githubusercontent.com/u/1015349?v=3","gravatar_id":"","url":"https://api.github.com/users/blblack","html_url":"https://github.com/blblack","followers_url":"https://api.github.com/users/blblack/followers","following_url":"https://api.github.com/users/blblack/following{/other_user}","gists_url":"https://api.github.com/users/blblack/gists{/gist_id}","starred_url":"https://api.github.com/users/blblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blblack/subscriptions","organizations_url":"https://api.github.com/users/blblack/orgs","repos_url":"https://api.github.com/users/blblack/repos","events_url":"https://api.github.com/users/blblack/events{/privacy}","received_events_url":"https://api.github.com/users/blblack/received_events","type":"User","site_admin":false},"body":"Should allow zero as a value","created_at":"2016-05-19T12:23:48Z","updated_at":"2016-05-19T12:23:48Z","html_url":"https://github.com/gdnsd/gdnsd/pull/123#discussion_r63868185","pull_request_url":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123","_links":{"self":{"href":"https://api.github.com/repos/gdnsd/gdnsd/pulls/comments/63868185"},"html":{"href":"https://github.com/gdnsd/gdnsd/pull/123#discussion_r63868185"},"pull_request":{"href":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123"}}},"pull_request":{"url":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123","id":70635128,"html_url":"https://github.com/gdnsd/gdnsd/pull/123","diff_url":"https://github.com/gdnsd/gdnsd/pull/123.diff","patch_url":"https://github.com/gdnsd/gdnsd/pull/123.patch","issue_url":"https://api.github.com/repos/gdnsd/gdnsd/issues/123","number":123,"state":"open","locked":false,"title":"Add a max_proc argument to extmon","user":{"login":"scaleengine","id":19313912,"avatar_url":"https://avatars.githubusercontent.com/u/19313912?v=3","gravatar_id":"","url":"https://api.github.com/users/scaleengine","html_url":"https://github.com/scaleengine","followers_url":"https://api.github.com/users/scaleengine/followers","following_url":"https://api.github.com/users/scaleengine/following{/other_user}","gists_url":"https://api.github.com/users/scaleengine/gists{/gist_id}","starred_url":"https://api.github.com/users/scaleengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaleengine/subscriptions","organizations_url":"https://api.github.com/users/scaleengine/orgs","repos_url":"https://api.github.com/users/scaleengine/repos","events_url":"https://api.github.com/users/scaleengine/events{/privacy}","received_events_url":"https://api.github.com/users/scaleengine/received_events","type":"User","site_admin":false},"body":"Limits the number of concurrent checks that will be spawned.\r\nIf the limit is reached, excess checks are rescheduled for 0.1 seconds later.\r\nThis prevents a thundering herd, and after a few runs spreads the load out fairly evenly.\r\n\r\nWith over 150 servers and 500 service checks, this was a requirement for us.","created_at":"2016-05-19T04:25:56Z","updated_at":"2016-05-19T12:23:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62444226eef9b854f2dc40dbb21f7e2d26b1e01d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123/commits","review_comments_url":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123/comments","review_comment_url":"https://api.github.com/repos/gdnsd/gdnsd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gdnsd/gdnsd/issues/123/comments","statuses_url":"https://api.github.com/repos/gdnsd/gdnsd/statuses/9f621ad2624707431d5dd8193ee2a1fe64552fa5","head":{"label":"scaleengine:master","ref":"master","sha":"9f621ad2624707431d5dd8193ee2a1fe64552fa5","user":{"login":"scaleengine","id":19313912,"avatar_url":"https://avatars.githubusercontent.com/u/19313912?v=3","gravatar_id":"","url":"https://api.github.com/users/scaleengine","html_url":"https://github.com/scaleengine","followers_url":"https://api.github.com/users/scaleengine/followers","following_url":"https://api.github.com/users/scaleengine/following{/other_user}","gists_url":"https://api.github.com/users/scaleengine/gists{/gist_id}","starred_url":"https://api.github.com/users/scaleengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaleengine/subscriptions","organizations_url":"https://api.github.com/users/scaleengine/orgs","repos_url":"https://api.github.com/users/scaleengine/repos","events_url":"https://api.github.com/users/scaleengine/events{/privacy}","received_events_url":"https://api.github.com/users/scaleengine/received_events","type":"User","site_admin":false},"repo":{"id":59169716,"name":"gdnsd","full_name":"scaleengine/gdnsd","owner":{"login":"scaleengine","id":19313912,"avatar_url":"https://avatars.githubusercontent.com/u/19313912?v=3","gravatar_id":"","url":"https://api.github.com/users/scaleengine","html_url":"https://github.com/scaleengine","followers_url":"https://api.github.com/users/scaleengine/followers","following_url":"https://api.github.com/users/scaleengine/following{/other_user}","gists_url":"https://api.github.com/users/scaleengine/gists{/gist_id}","starred_url":"https://api.github.com/users/scaleengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaleengine/subscriptions","organizations_url":"https://api.github.com/users/scaleengine/orgs","repos_url":"https://api.github.com/users/scaleengine/repos","events_url":"https://api.github.com/users/scaleengine/events{/privacy}","received_events_url":"https://api.github.com/users/scaleengine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scaleengine/gdnsd","description":"Authoritative DNS Server -- ","fork":true,"url":"https://api.github.com/repos/scaleengine/gdnsd","forks_url":"https://api.github.com/repos/scaleengine/gdnsd/forks","keys_url":"https://api.github.com/repos/scaleengine/gdnsd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scaleengine/gdnsd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scaleengine/gdnsd/teams","hooks_url":"https://api.github.com/repos/scaleengine/gdnsd/hooks","issue_events_url":"https://api.github.com/repos/scaleengine/gdnsd/issues/events{/number}","events_url":"https://api.github.com/repos/scaleengine/gdnsd/events","assignees_url":"https://api.github.com/repos/scaleengine/gdnsd/assignees{/user}","branches_url":"https://api.github.com/repos/scaleengine/gdnsd/branches{/branch}","tags_url":"https://api.github.com/repos/scaleengine/gdnsd/tags","blobs_url":"https://api.github.com/repos/scaleengine/gdnsd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scaleengine/gdnsd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scaleengine/gdnsd/git/refs{/sha}","trees_url":"https://api.github.com/repos/scaleengine/gdnsd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scaleengine/gdnsd/statuses/{sha}","languages_url":"https://api.github.com/repos/scaleengine/gdnsd/languages","stargazers_url":"https://api.github.com/repos/scaleengine/gdnsd/stargazers","contributors_url":"https://api.github.com/repos/scaleengine/gdnsd/contributors","subscribers_url":"https://api.github.com/repos/scaleengine/gdnsd/subscribers","subscription_url":"https://api.github.com/repos/scaleengine/gdnsd/subscription","commits_url":"https://api.github.com/repos/scaleengine/gdnsd/commits{/sha}","git_commits_url":"https://api.github.com/repos/scaleengine/gdnsd/git/commits{/sha}","comments_url":"https://api.github.com/repos/scaleengine/gdnsd/comments{/number}","issue_comment_url":"https://api.github.com/repos/scaleengine/gdnsd/issues/comments{/number}","contents_url":"https://api.github.com/repos/scaleengine/gdnsd/contents/{+path}","compare_url":"https://api.github.com/repos/scaleengine/gdnsd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scaleengine/gdnsd/merges","archive_url":"https://api.github.com/repos/scaleengine/gdnsd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scaleengine/gdnsd/downloads","issues_url":"https://api.github.com/repos/scaleengine/gdnsd/issues{/number}","pulls_url":"https://api.github.com/repos/scaleengine/gdnsd/pulls{/number}","milestones_url":"https://api.github.com/repos/scaleengine/gdnsd/milestones{/number}","notifications_url":"https://api.github.com/repos/scaleengine/gdnsd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scaleengine/gdnsd/labels{/name}","releases_url":"https://api.github.com/repos/scaleengine/gdnsd/releases{/id}","deployments_url":"https://api.github.com/repos/scaleengine/gdnsd/deployments","created_at":"2016-05-19T03:09:15Z","updated_at":"2016-05-19T03:09:19Z","pushed_at":"2016-05-19T04:25:08Z","git_url":"git://github.com/scaleengine/gdnsd.git","ssh_url":"git@github.com:scaleengine/gdnsd.git","clone_url":"https://github.com/scaleengine/gdnsd.git","svn_url":"https://github.com/scaleengine/gdnsd","homepage":"http://gdnsd.org/","size":4999,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gdnsd:master","ref":"master","sha":"ccb356eed5bf7c42faf59afe60f319b171a4ed9b","user":{"login":"gdnsd","id":9117831,"avatar_url":"https://avatars.githubusercontent.com/u/9117831?v=3","gravatar_id":"","url":"https://api.github.com/users/gdnsd","html_url":"https://github.com/gdnsd","followers_url":"https://api.github.com/users/gdnsd/followers","following_url":"https://api.github.com/users/gdnsd/following{/other_user}","gists_url":"https://api.github.com/users/gdnsd/gists{/gist_id}","starred_url":"https://api.github.com/users/gdnsd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdnsd/subscriptions","organizations_url":"https://api.github.com/users/gdnsd/orgs","repos_url":"https://api.github.com/users/gdnsd/repos","events_url":"https://api.github.com/users/gdnsd/events{/privacy}","received_events_url":"https://api.github.com/users/gdnsd/received_events","type":"Organization","site_admin":false},"repo":{"id":4484495,"name":"gdnsd","full_name":"gdnsd/gdnsd","owner":{"login":"gdnsd","id":9117831,"avatar_url":"https://avatars.githubusercontent.com/u/9117831?v=3","gravatar_id":"","url":"https://api.github.com/users/gdnsd","html_url":"https://github.com/gdnsd","followers_url":"https://api.github.com/users/gdnsd/followers","following_url":"https://api.github.com/users/gdnsd/following{/other_user}","gists_url":"https://api.github.com/users/gdnsd/gists{/gist_id}","starred_url":"https://api.github.com/users/gdnsd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdnsd/subscriptions","organizations_url":"https://api.github.com/users/gdnsd/orgs","repos_url":"https://api.github.com/users/gdnsd/repos","events_url":"https://api.github.com/users/gdnsd/events{/privacy}","received_events_url":"https://api.github.com/users/gdnsd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gdnsd/gdnsd","description":"Authoritative DNS Server -- ","fork":false,"url":"https://api.github.com/repos/gdnsd/gdnsd","forks_url":"https://api.github.com/repos/gdnsd/gdnsd/forks","keys_url":"https://api.github.com/repos/gdnsd/gdnsd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gdnsd/gdnsd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gdnsd/gdnsd/teams","hooks_url":"https://api.github.com/repos/gdnsd/gdnsd/hooks","issue_events_url":"https://api.github.com/repos/gdnsd/gdnsd/issues/events{/number}","events_url":"https://api.github.com/repos/gdnsd/gdnsd/events","assignees_url":"https://api.github.com/repos/gdnsd/gdnsd/assignees{/user}","branches_url":"https://api.github.com/repos/gdnsd/gdnsd/branches{/branch}","tags_url":"https://api.github.com/repos/gdnsd/gdnsd/tags","blobs_url":"https://api.github.com/repos/gdnsd/gdnsd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gdnsd/gdnsd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gdnsd/gdnsd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gdnsd/gdnsd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gdnsd/gdnsd/statuses/{sha}","languages_url":"https://api.github.com/repos/gdnsd/gdnsd/languages","stargazers_url":"https://api.github.com/repos/gdnsd/gdnsd/stargazers","contributors_url":"https://api.github.com/repos/gdnsd/gdnsd/contributors","subscribers_url":"https://api.github.com/repos/gdnsd/gdnsd/subscribers","subscription_url":"https://api.github.com/repos/gdnsd/gdnsd/subscription","commits_url":"https://api.github.com/repos/gdnsd/gdnsd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gdnsd/gdnsd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gdnsd/gdnsd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gdnsd/gdnsd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gdnsd/gdnsd/contents/{+path}","compare_url":"https://api.github.com/repos/gdnsd/gdnsd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gdnsd/gdnsd/merges","archive_url":"https://api.github.com/repos/gdnsd/gdnsd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gdnsd/gdnsd/downloads","issues_url":"https://api.github.com/repos/gdnsd/gdnsd/issues{/number}","pulls_url":"https://api.github.com/repos/gdnsd/gdnsd/pulls{/number}","milestones_url":"https://api.github.com/repos/gdnsd/gdnsd/milestones{/number}","notifications_url":"https://api.github.com/repos/gdnsd/gdnsd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gdnsd/gdnsd/labels{/name}","releases_url":"https://api.github.com/repos/gdnsd/gdnsd/releases{/id}","deployments_url":"https://api.github.com/repos/gdnsd/gdnsd/deployments","created_at":"2012-05-29T16:22:51Z","updated_at":"2016-05-07T07:56:23Z","pushed_at":"2016-05-19T04:25:57Z","git_url":"git://github.com/gdnsd/gdnsd.git","ssh_url":"git@github.com:gdnsd/gdnsd.git","clone_url":"https://github.com/gdnsd/gdnsd.git","svn_url":"https://github.com/gdnsd/gdnsd","homepage":"http://gdnsd.org/","size":5569,"stargazers_count":149,"watchers_count":149,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":21,"forks":24,"open_issues":21,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123"},"html":{"href":"https://github.com/gdnsd/gdnsd/pull/123"},"issue":{"href":"https://api.github.com/repos/gdnsd/gdnsd/issues/123"},"comments":{"href":"https://api.github.com/repos/gdnsd/gdnsd/issues/123/comments"},"review_comments":{"href":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123/comments"},"review_comment":{"href":"https://api.github.com/repos/gdnsd/gdnsd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gdnsd/gdnsd/pulls/123/commits"},"statuses":{"href":"https://api.github.com/repos/gdnsd/gdnsd/statuses/9f621ad2624707431d5dd8193ee2a1fe64552fa5"}}}}