{"id":169,"date":"2009-11-08T09:23:00","date_gmt":"2009-11-08T07:23:00","guid":{"rendered":"http:\/\/code.openark.org\/forge\/?page_id=169"},"modified":"2010-09-06T09:51:56","modified_gmt":"2010-09-06T07:51:56","slug":"usage","status":"publish","type":"page","link":"https:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/usage","title":{"rendered":"Usage"},"content":{"rendered":"<p><em>mycheckpoint<\/em> is used in two ways:<\/p>\n<ol>\n<li>For recording status data (one would issue this every few minutes, repeatedly, as in <em>crontab<\/em>)<\/li>\n<li>As an HTTP server, serving HTML reports (as of revision <strong>190<\/strong>)<\/li>\n<\/ol>\n<p>When recording status data, you may:<\/p>\n<ul>\n<li>Monitor and write to a single server<\/li>\n<li>Monitor one server, writing to another (e.g. monitoring a slave server, writing to the master server)<\/li>\n<\/ul>\n<p>See <strong><a href=\"#use_case_local\">Use case, local monitoring<\/a><\/strong>, <strong><a href=\"#use_case_remote\">Use case, remote monitoring<\/a><\/strong>, below, for a simple setup.<\/p>\n<h4>Help<\/h4>\n<p>To get full list of available options, run:<\/p>\n<blockquote>\n<pre>mycheckpoint --help<\/pre>\n<\/blockquote>\n<h4>Simple usage<\/h4>\n<blockquote>\n<pre>mycheckpoint\r\n<\/pre>\n<\/blockquote>\n<h4>Deploying &amp; auto-deploying <em>mycheckpoint<\/em><\/h4>\n<p>As of revision <strong>72<\/strong>, <em>mycheckpoint<\/em> has an <strong>auto-deploy<\/strong> mechanism. This means there is no specific action to take when upgrading <em>mycheckpoint<\/em> or installing a new version. It will automatically detect version change, rebuild tables, views; add missing columns; and, finally, monitor your database.<\/p>\n<h4>To strictly deploy (setup) mycheckpoint, without monitoring status<\/h4>\n<p>Pass the &#8220;<strong>deploy<\/strong>&#8221; command line argument:<\/p>\n<blockquote>\n<pre>mycheckpoint <strong>deploy<\/strong><\/pre>\n<\/blockquote>\n<p>Single server: provide connection parameters (see <a href=\"#defaults_file\"><strong>Defaults file<\/strong><\/a> following), optionally verbose:<\/p>\n<blockquote>\n<pre>mycheckpoint --host=myserver <strong>--port<\/strong>=17401 --user=msandbox --password=msandbox <strong>deploy<\/strong><\/pre>\n<\/blockquote>\n<blockquote>\n<pre>mycheckpoint --host=localhost <strong>--socket<\/strong>=\/tmp\/mysql_sandbox17401.sock --user=msandbox --password=msandbox -v <strong>deploy<\/strong><\/pre>\n<\/blockquote>\n<blockquote>\n<pre>mycheckpoint <strong>--defaults-file<\/strong>=\/root\/.my-checkpoint.cnf --verbose <strong>deploy<\/strong><\/pre>\n<\/blockquote>\n<p>Setting up Google charts configuration (see also <a href=\"http:\/\/code.google.com\/apis\/chart\/basics.html#chart_size\">Chart Basics<\/a>):<\/p>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf --chart-width=500 --chart-height=300 --chart-service-url=http:\/\/127.0.0.1\/eastwood\/chart deploy<\/pre>\n<\/blockquote>\n<h4>Usage for recording status data<\/h4>\n<p>Take a recording (sampling) of current status and variables; purge old data:<\/p>\n<blockquote>\n<pre>mycheckpoint<\/pre>\n<\/blockquote>\n<p>Provide connection parameters (see <a href=\"#defaults_file\"><strong>Defaults file<\/strong><\/a> following):<\/p>\n<blockquote>\n<pre>mycheckpoint --user=msandbox --password=msandbox --host=myserver --port=17401<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>mycheckpoint --user=msandbox --password=msandbox --host=localhost --socket=\/tmp\/mysql_sandbox17401.sock<\/pre>\n<\/blockquote>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf<\/pre>\n<\/blockquote>\n<p>Same as above, verbose:<\/p>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf -v<\/pre>\n<\/blockquote>\n<p>Specify database name other than mycheckpoint:<\/p>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf -v <strong>--database=<\/strong>my_other_schema<\/pre>\n<\/blockquote>\n<p>Remote host monitoring (should most probably supply database name)<\/p>\n<blockquote>\n<pre>mycheckpoint <strong>--monitored-host=<\/strong>slave01.mynetwork.com <strong>--database<\/strong>=mycheckpoint_slave01<strong> <\/strong>--defaults-file=\/root\/.my-checkpoint.cnf -v<\/pre>\n<\/blockquote>\n<p>Specify purge days: rows older than given number of days will be removed (default is 182, approx. 6 months)<\/p>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf --verbose <strong>--purge-days<\/strong>=62<\/pre>\n<\/blockquote>\n<p>If monitoring user does not have <strong>SUPER<\/strong> nor <strong>REPLICATION CLIENT<\/strong> privileges (see <a href=\"replication\">Replication<\/a> page):<\/p>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf -v <strong>--skip-check-replication<\/strong><\/pre>\n<\/blockquote>\n<p><a name=\"defaults_file\"><\/a><\/p>\n<h4>Defaults file<\/h4>\n<p>To avoid passing user+password on command line, one may provide with the <strong>&#8211;defaults-file<\/strong> option. The file must be provided in full path (i.e. <strong>~\/.my-checkpoint.cnf<\/strong> home shortcut is <em>invalid<\/em>).<\/p>\n<p>The default defaults file is expected on <strong>\/etc\/mycheckpoint.cnf<\/strong>. If this file exists, one does not have to specify <strong>&#8211;defaults-file<\/strong> on the command line.<\/p>\n<p>A defaults file is similar in structure to my.cnf. It may include the following:<\/p>\n<blockquote>\n<pre>[mycheckpoint]\r\nsmtp_host = mail.my-server-company.com\r\nsmtp_from = monitor@my-server-company.com\r\nsmtp_to = dba@my-server-company.com\r\nmonitored_port = 3306\r\npurge_days = 60\r\n#... Any command line option can go here; replace dash (\"-\") with underscored (\"_\")\r\n\r\n[client]\r\nuser=dbmonitor\r\npassword=123456\r\nsocket=\/tmp\/mysql.sock\r\nport=3306\r\nhost=localhost<\/pre>\n<\/blockquote>\n<p><a name=\"use_case_local\"><\/a><\/p>\n<h4>Use case, local monitoring<\/h4>\n<p>Once <em>mycheckpoint<\/em> is <a href=\"installation\">installed<\/a>, add repeating monitoring to <em>crontab<\/em>:<\/p>\n<blockquote>\n<pre>*\/5 * * * *\u00a0\u00a0\u00a0\u00a0 mycheckpoint --defaults-file=\/root\/.my-checkpoint.cnf<\/pre>\n<\/blockquote>\n<p><a name=\"use_case_remote\"><\/a><\/p>\n<h4>Use case, remote monitoring<\/h4>\n<p>Once <em>mycheckpoint<\/em> is <a href=\"installation\">installed<\/a> on master node, add repeating monitoring to <em>crontab<\/em>:<\/p>\n<blockquote>\n<pre>*\/5 * * * *\u00a0\u00a0\u00a0\u00a0 mycheckpoint --monitored-host=<strong>master.mynetwork.com<\/strong> --database=<strong>mycehckpoint_master<\/strong> --defaults-file=\/root\/.my-checkpoint.cnf\r\n*\/5 * * * *\u00a0\u00a0\u00a0\u00a0 mycheckpoint --monitored-host=<strong>slave1.mynetwork.com<\/strong> --database=<strong>mycehckpoint_slave1<\/strong> --defaults-file=\/root\/.my-checkpoint.cnf\r\n*\/5 * * * *\u00a0\u00a0\u00a0\u00a0 mycheckpoint --monitored-host=<strong>slave2.mynetwork.com<\/strong> --database=<strong>mycehckpoint_slave2<\/strong> --defaults-file=\/root\/.my-checkpoint.cnf<\/pre>\n<\/blockquote>\n<p>Note:<\/p>\n<ul>\n<li>We use distinct databases per monitored MySQL server<\/li>\n<li>We do monitoring per MySQL server separately.<\/li>\n<\/ul>\n<p>See <a href=\"remote-multiple-hosts\">Remote &amp; multiple hosts<\/a> for more details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mycheckpoint is used in two ways: For recording status data (one would issue this every few minutes, repeatedly, as in crontab) As an HTTP server, serving HTML reports (as of revision 190) When recording status data, you may: Monitor and write to a single server Monitor one server, writing to another (e.g. monitoring a slave [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":147,"menu_order":-7,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-169","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/pages\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":33,"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/pages\/169\/revisions"}],"predecessor-version":[{"id":177,"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/pages\/169\/revisions\/177"}],"up":[{"embeddable":true,"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/pages\/147"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/forge\/wp-json\/wp\/v2\/media?parent=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}