{"action":"created","comment":{"url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/comments/34165270","id":34165270,"diff_hunk":"@@ -230,4 +230,50 @@\n             ]\n         end\n     end\n+\n+    cookbook_file \"/tmp/zabbix-mysql-partition-baseline.sql\" do\n+        source \"zabbix-mysql-partition-baseline.sql\"\n+        owner \"root\"\n+        mode 00644\n+    end\n+\n+    template \"/tmp/zabbix-mysql-partition-maintenance-all.sql\" do\n+        source \"zabbix-mysql-partition-maintenance-all.sql.erb\"\n+        owner \"root\"\n+        group \"root\"\n+        mode 00644\n+        variables(\n+            :storage_retention => node['bcpc']['zabbix']['storage_retention']\n+        )\n+    end\n+\n+    # Create baseline stored procedures to setup partitioning\n+    ruby_block \"zabbix-partition-baseline-setup\" do\n+        block do\n+            %x[ export MYSQL_PWD=#{get_config('mysql-zabbix-password')};\n+                mysql -u#{get_config('mysql-zabbix-user')} #{node['bcpc']['dbname']['zabbix']} < /tmp/zabbix-mysql-partition-baseline.sql\n+            ]\n+        end\n+        not_if { system \"MYSQL_PWD=#{get_config('mysql-monitoring-root-password')} mysql -uroot -e 'SELECT name FROM mysql.proc WHERE db = \\\"#{node['bcpc']['dbname']['zabbix']}\\\" AND type = \\\"procedure\\\" AND name LIKE \\\"partition%\\\"' | grep -q partition >/dev/null\" }\n+    end\n+\n+    # Creates wrapper stored procedure to execute partitioning, then\n+    # reconfigures Zabbix housekeeping to match partitioning setup\n+    ruby_block \"zabbix-mysql-partition-maintenance-all\" do\n+        block do\n+            %x[ export MYSQL_PWD=#{get_config('mysql-zabbix-password')};\n+                mysql -u#{get_config('mysql-zabbix-user')} #{node['bcpc']['dbname']['zabbix']} < /tmp/zabbix-mysql-partition-maintenance-all.sql\n+            ]\n+        end\n+    end\n+\n+    # Partitions need to be pre-extended, so running this as a daily crontab\n+    cron 'partition-maintenance-all' do\n+        minute '7'\n+        hour '0'\n+        user 'zabbix'\n+        environment ({'MYSQL_PWD' => \"#{get_config('mysql-zabbix-password')}\"})","path":"cookbooks/bcpc/recipes/zabbix-server.rb","position":46,"original_position":46,"commit_id":"87b1ffda84c4b4c9c1c1610b9ff7a2d9f5b5ced9","original_commit_id":"87b1ffda84c4b4c9c1c1610b9ff7a2d9f5b5ced9","user":{"login":"kelvk","id":9847174,"avatar_url":"https://avatars.githubusercontent.com/u/9847174?v=3","gravatar_id":"","url":"https://api.github.com/users/kelvk","html_url":"https://github.com/kelvk","followers_url":"https://api.github.com/users/kelvk/followers","following_url":"https://api.github.com/users/kelvk/following{/other_user}","gists_url":"https://api.github.com/users/kelvk/gists{/gist_id}","starred_url":"https://api.github.com/users/kelvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelvk/subscriptions","organizations_url":"https://api.github.com/users/kelvk/orgs","repos_url":"https://api.github.com/users/kelvk/repos","events_url":"https://api.github.com/users/kelvk/events{/privacy}","received_events_url":"https://api.github.com/users/kelvk/received_events","type":"User","site_admin":false},"body":":(\r\n\r\nI rebuilt VMs from snapshot but did not purge the bootstrap. I will fix.","created_at":"2015-07-08T16:00:44Z","updated_at":"2015-07-08T16:00:44Z","html_url":"https://github.com/bloomberg/chef-bcpc/pull/692#discussion_r34165270","pull_request_url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692","_links":{"self":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/comments/34165270"},"html":{"href":"https://github.com/bloomberg/chef-bcpc/pull/692#discussion_r34165270"},"pull_request":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692"}}},"pull_request":{"url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692","id":39424110,"html_url":"https://github.com/bloomberg/chef-bcpc/pull/692","diff_url":"https://github.com/bloomberg/chef-bcpc/pull/692.diff","patch_url":"https://github.com/bloomberg/chef-bcpc/pull/692.patch","issue_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/692","number":692,"state":"open","locked":false,"title":"MySQL partitioning for Zabbix","user":{"login":"kelvk","id":9847174,"avatar_url":"https://avatars.githubusercontent.com/u/9847174?v=3","gravatar_id":"","url":"https://api.github.com/users/kelvk","html_url":"https://github.com/kelvk","followers_url":"https://api.github.com/users/kelvk/followers","following_url":"https://api.github.com/users/kelvk/following{/other_user}","gists_url":"https://api.github.com/users/kelvk/gists{/gist_id}","starred_url":"https://api.github.com/users/kelvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelvk/subscriptions","organizations_url":"https://api.github.com/users/kelvk/orgs","repos_url":"https://api.github.com/users/kelvk/repos","events_url":"https://api.github.com/users/kelvk/events{/privacy}","received_events_url":"https://api.github.com/users/kelvk/received_events","type":"User","site_admin":false},"body":"Zabbix housekeeper can bog down a system significantly when history/trend tables are large, thereby impacting other services that run on the system. Partitioning the tables (http://zabbix.org/wiki/Docs/howto/mysql_partition) and transferring the responsibility of housekeeping the tables to stored procedures yields much better responsiveness. ","created_at":"2015-07-07T22:31:22Z","updated_at":"2015-07-08T16:00:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ece04579bc508b7724d746ab04658e7568f43177","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692/commits","review_comments_url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692/comments","review_comment_url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/692/comments","statuses_url":"https://api.github.com/repos/bloomberg/chef-bcpc/statuses/87b1ffda84c4b4c9c1c1610b9ff7a2d9f5b5ced9","head":{"label":"kelvk:feature/zabbix-mysql-partition","ref":"feature/zabbix-mysql-partition","sha":"87b1ffda84c4b4c9c1c1610b9ff7a2d9f5b5ced9","user":{"login":"kelvk","id":9847174,"avatar_url":"https://avatars.githubusercontent.com/u/9847174?v=3","gravatar_id":"","url":"https://api.github.com/users/kelvk","html_url":"https://github.com/kelvk","followers_url":"https://api.github.com/users/kelvk/followers","following_url":"https://api.github.com/users/kelvk/following{/other_user}","gists_url":"https://api.github.com/users/kelvk/gists{/gist_id}","starred_url":"https://api.github.com/users/kelvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelvk/subscriptions","organizations_url":"https://api.github.com/users/kelvk/orgs","repos_url":"https://api.github.com/users/kelvk/repos","events_url":"https://api.github.com/users/kelvk/events{/privacy}","received_events_url":"https://api.github.com/users/kelvk/received_events","type":"User","site_admin":false},"repo":{"id":26870841,"name":"chef-bcpc","full_name":"kelvk/chef-bcpc","owner":{"login":"kelvk","id":9847174,"avatar_url":"https://avatars.githubusercontent.com/u/9847174?v=3","gravatar_id":"","url":"https://api.github.com/users/kelvk","html_url":"https://github.com/kelvk","followers_url":"https://api.github.com/users/kelvk/followers","following_url":"https://api.github.com/users/kelvk/following{/other_user}","gists_url":"https://api.github.com/users/kelvk/gists{/gist_id}","starred_url":"https://api.github.com/users/kelvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelvk/subscriptions","organizations_url":"https://api.github.com/users/kelvk/orgs","repos_url":"https://api.github.com/users/kelvk/repos","events_url":"https://api.github.com/users/kelvk/events{/privacy}","received_events_url":"https://api.github.com/users/kelvk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kelvk/chef-bcpc","description":"A set of recipes for Chef used to build Bloomberg Clustered Private Cloud nodes.","fork":true,"url":"https://api.github.com/repos/kelvk/chef-bcpc","forks_url":"https://api.github.com/repos/kelvk/chef-bcpc/forks","keys_url":"https://api.github.com/repos/kelvk/chef-bcpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kelvk/chef-bcpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kelvk/chef-bcpc/teams","hooks_url":"https://api.github.com/repos/kelvk/chef-bcpc/hooks","issue_events_url":"https://api.github.com/repos/kelvk/chef-bcpc/issues/events{/number}","events_url":"https://api.github.com/repos/kelvk/chef-bcpc/events","assignees_url":"https://api.github.com/repos/kelvk/chef-bcpc/assignees{/user}","branches_url":"https://api.github.com/repos/kelvk/chef-bcpc/branches{/branch}","tags_url":"https://api.github.com/repos/kelvk/chef-bcpc/tags","blobs_url":"https://api.github.com/repos/kelvk/chef-bcpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kelvk/chef-bcpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kelvk/chef-bcpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/kelvk/chef-bcpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kelvk/chef-bcpc/statuses/{sha}","languages_url":"https://api.github.com/repos/kelvk/chef-bcpc/languages","stargazers_url":"https://api.github.com/repos/kelvk/chef-bcpc/stargazers","contributors_url":"https://api.github.com/repos/kelvk/chef-bcpc/contributors","subscribers_url":"https://api.github.com/repos/kelvk/chef-bcpc/subscribers","subscription_url":"https://api.github.com/repos/kelvk/chef-bcpc/subscription","commits_url":"https://api.github.com/repos/kelvk/chef-bcpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/kelvk/chef-bcpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/kelvk/chef-bcpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/kelvk/chef-bcpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/kelvk/chef-bcpc/contents/{+path}","compare_url":"https://api.github.com/repos/kelvk/chef-bcpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kelvk/chef-bcpc/merges","archive_url":"https://api.github.com/repos/kelvk/chef-bcpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kelvk/chef-bcpc/downloads","issues_url":"https://api.github.com/repos/kelvk/chef-bcpc/issues{/number}","pulls_url":"https://api.github.com/repos/kelvk/chef-bcpc/pulls{/number}","milestones_url":"https://api.github.com/repos/kelvk/chef-bcpc/milestones{/number}","notifications_url":"https://api.github.com/repos/kelvk/chef-bcpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kelvk/chef-bcpc/labels{/name}","releases_url":"https://api.github.com/repos/kelvk/chef-bcpc/releases{/id}","created_at":"2014-11-19T16:39:44Z","updated_at":"2015-02-25T21:45:35Z","pushed_at":"2015-07-08T15:07:48Z","git_url":"git://github.com/kelvk/chef-bcpc.git","ssh_url":"git@github.com:kelvk/chef-bcpc.git","clone_url":"https://github.com/kelvk/chef-bcpc.git","svn_url":"https://github.com/kelvk/chef-bcpc","homepage":null,"size":3879,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"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":"bloomberg:master","ref":"master","sha":"ae4ef736168cb3a441d37076d70b6509151edcba","user":{"login":"bloomberg","id":1416818,"avatar_url":"https://avatars.githubusercontent.com/u/1416818?v=3","gravatar_id":"","url":"https://api.github.com/users/bloomberg","html_url":"https://github.com/bloomberg","followers_url":"https://api.github.com/users/bloomberg/followers","following_url":"https://api.github.com/users/bloomberg/following{/other_user}","gists_url":"https://api.github.com/users/bloomberg/gists{/gist_id}","starred_url":"https://api.github.com/users/bloomberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloomberg/subscriptions","organizations_url":"https://api.github.com/users/bloomberg/orgs","repos_url":"https://api.github.com/users/bloomberg/repos","events_url":"https://api.github.com/users/bloomberg/events{/privacy}","received_events_url":"https://api.github.com/users/bloomberg/received_events","type":"Organization","site_admin":false},"repo":{"id":9452427,"name":"chef-bcpc","full_name":"bloomberg/chef-bcpc","owner":{"login":"bloomberg","id":1416818,"avatar_url":"https://avatars.githubusercontent.com/u/1416818?v=3","gravatar_id":"","url":"https://api.github.com/users/bloomberg","html_url":"https://github.com/bloomberg","followers_url":"https://api.github.com/users/bloomberg/followers","following_url":"https://api.github.com/users/bloomberg/following{/other_user}","gists_url":"https://api.github.com/users/bloomberg/gists{/gist_id}","starred_url":"https://api.github.com/users/bloomberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bloomberg/subscriptions","organizations_url":"https://api.github.com/users/bloomberg/orgs","repos_url":"https://api.github.com/users/bloomberg/repos","events_url":"https://api.github.com/users/bloomberg/events{/privacy}","received_events_url":"https://api.github.com/users/bloomberg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bloomberg/chef-bcpc","description":"A set of recipes for Chef used to build Bloomberg Clustered Private Cloud nodes.","fork":false,"url":"https://api.github.com/repos/bloomberg/chef-bcpc","forks_url":"https://api.github.com/repos/bloomberg/chef-bcpc/forks","keys_url":"https://api.github.com/repos/bloomberg/chef-bcpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bloomberg/chef-bcpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bloomberg/chef-bcpc/teams","hooks_url":"https://api.github.com/repos/bloomberg/chef-bcpc/hooks","issue_events_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/events{/number}","events_url":"https://api.github.com/repos/bloomberg/chef-bcpc/events","assignees_url":"https://api.github.com/repos/bloomberg/chef-bcpc/assignees{/user}","branches_url":"https://api.github.com/repos/bloomberg/chef-bcpc/branches{/branch}","tags_url":"https://api.github.com/repos/bloomberg/chef-bcpc/tags","blobs_url":"https://api.github.com/repos/bloomberg/chef-bcpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bloomberg/chef-bcpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bloomberg/chef-bcpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/bloomberg/chef-bcpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bloomberg/chef-bcpc/statuses/{sha}","languages_url":"https://api.github.com/repos/bloomberg/chef-bcpc/languages","stargazers_url":"https://api.github.com/repos/bloomberg/chef-bcpc/stargazers","contributors_url":"https://api.github.com/repos/bloomberg/chef-bcpc/contributors","subscribers_url":"https://api.github.com/repos/bloomberg/chef-bcpc/subscribers","subscription_url":"https://api.github.com/repos/bloomberg/chef-bcpc/subscription","commits_url":"https://api.github.com/repos/bloomberg/chef-bcpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/bloomberg/chef-bcpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/bloomberg/chef-bcpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/bloomberg/chef-bcpc/contents/{+path}","compare_url":"https://api.github.com/repos/bloomberg/chef-bcpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bloomberg/chef-bcpc/merges","archive_url":"https://api.github.com/repos/bloomberg/chef-bcpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bloomberg/chef-bcpc/downloads","issues_url":"https://api.github.com/repos/bloomberg/chef-bcpc/issues{/number}","pulls_url":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls{/number}","milestones_url":"https://api.github.com/repos/bloomberg/chef-bcpc/milestones{/number}","notifications_url":"https://api.github.com/repos/bloomberg/chef-bcpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bloomberg/chef-bcpc/labels{/name}","releases_url":"https://api.github.com/repos/bloomberg/chef-bcpc/releases{/id}","created_at":"2013-04-15T15:56:32Z","updated_at":"2015-07-07T11:05:02Z","pushed_at":"2015-07-08T15:07:49Z","git_url":"git://github.com/bloomberg/chef-bcpc.git","ssh_url":"git@github.com:bloomberg/chef-bcpc.git","clone_url":"https://github.com/bloomberg/chef-bcpc.git","svn_url":"https://github.com/bloomberg/chef-bcpc","homepage":null,"size":8975,"stargazers_count":120,"watchers_count":120,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":56,"mirror_url":null,"open_issues_count":94,"forks":56,"open_issues":94,"watchers":120,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692"},"html":{"href":"https://github.com/bloomberg/chef-bcpc/pull/692"},"issue":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/692"},"comments":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/issues/692/comments"},"review_comments":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692/comments"},"review_comment":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/pulls/692/commits"},"statuses":{"href":"https://api.github.com/repos/bloomberg/chef-bcpc/statuses/87b1ffda84c4b4c9c1c1610b9ff7a2d9f5b5ced9"}}}}