{"id":2221,"date":"2010-03-25T08:26:34","date_gmt":"2010-03-25T06:26:34","guid":{"rendered":"http:\/\/code.openark.org\/blog\/?p=2221"},"modified":"2010-05-21T15:28:03","modified_gmt":"2010-05-21T13:28:03","slug":"mycheckpoint-rev-118-alerts-email-notifications-and-more","status":"publish","type":"post","link":"https:\/\/code.openark.org\/blog\/mysql\/mycheckpoint-rev-118-alerts-email-notifications-and-more","title":{"rendered":"mycheckpoint (Rev. 118): alerts, email notifications and more"},"content":{"rendered":"<p>Revision <strong>118<\/strong> of <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\">mycheckpoint<\/a> has been released. New and updated in this revision:<\/p>\n<ul>\n<li>Conditional alerts<\/li>\n<li>Email notifications<\/li>\n<li>Revised HTML reports, including 24\/7 reports.<\/li>\n<li>Updated documentation<\/li>\n<\/ul>\n<p>With this new revision mycheckpoint turns into a <em>monitoring solution<\/em> for MySQL. One can now:<\/p>\n<ul>\n<li>Store measure metrics<\/li>\n<li>Query for raw, aggregated or digested metrics<\/li>\n<li>Generate charts for selected metrics<\/li>\n<li>View HTML reports for selecetd metrics<\/li>\n<li>Define alerts conditions, query for pending alerts<\/li>\n<li>Be notified via <em>email<\/em> on <em>raised<\/em> or <em>resolved<\/em> alerts.<\/li>\n<\/ul>\n<h4>Conditional alerts<\/h4>\n<p><em>mycheckpoint<\/em> is <em>SQL oriented<\/em>. As such, it allows for creation of alert conditions, which are nothing more than SQL conditions.<\/p>\n<p><!--more-->For example, we wish to raise an alerts when the slave stops replicating (just ping us with an email one this happens):<\/p>\n<blockquote>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">INSERT INTO alert_condition (condition_eval, description, alert_delay_minutes)\r\n  VALUES ('seconds_behind_master IS NULL', 'Slave not replicating', 0);<\/pre>\n<\/blockquote>\n<p>Or is too far behind (but since we do maintenance work during the night, it&#8217;s OK on those hours). We only want to be notified if this goes on for <strong>10<\/strong> minutes:<\/p>\n<blockquote>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">INSERT INTO alert_condition (condition_eval, description, alert_delay_minutes)\r\n  VALUES ('(seconds_behind_master &gt; 60) AND (HOUR(ts) NOT BETWEEN 2 AND 4)', 'Slave lags too far behind', 10);<\/pre>\n<\/blockquote>\n<p>We want to be notified when the <strong>datadir<\/strong> mount point disk quota exceeds 95% usage. Oh, and please keep nagging us about this, as long as it is unresolved:<\/p>\n<blockquote>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">INSERT INTO alert_condition (condition_eval, description, repetitive_alert)\r\n  VALUES ('os_datadir_mountpoint_usage_percent &gt; 95', 'datadir mount point is over 95%', 1);<\/pre>\n<\/blockquote>\n<p>There&#8217;s much more to alert conditions. You can generate a pending alerts report, get a textual presentation of raised and pending alerts, view the query which determines what alerts are currently raised, and more.<\/p>\n<p>Read more on the <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/alerts\">alerts documentation page<\/a>.<\/p>\n<h4>Email notifications<\/h4>\n<p>Introducing email notifications, <em>mycheckpoint<\/em> now:<\/p>\n<ul>\n<li>Sends email notification on alert conditions meeting. See <a href=\"http:\/\/code.openark.org\/forge\/wp-content\/uploads\/2010\/03\/mycheckpoint-alerts-email-sample-113.jpeg\">sample email screenshot<\/a>.<\/li>\n<li>Sends email notification when it is unable to access the database.<\/li>\n<li>Sends report via mail. Currently only HTML brief report is supported. Report is attached as HTML file in email message.<\/li>\n<\/ul>\n<p>Alert notifications are automatically sent by mail (once SMTP configuration is in place, see following) when an alert is <em>raised<\/em> (alert condition becomes <strong>true<\/strong>) or <em>resolved<\/em> (alert condition turns <strong>false<\/strong>).<\/p>\n<p>Email notifications require simple configuration for SMTP host, SMTP-from-address, SMTP-to-address. These can be made in the <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/usage#defaults_file\">defaults file<\/a> (revised), or through the command line. The following example shows how one can manually send an HTML brief report:<\/p>\n<blockquote>\n<pre>mycheckpoint --defaults-file=\/etc\/mycheckpoint.cnf <strong>--smtp-from<\/strong>=monitor@my-server-company.com <strong>--smtp-to<\/strong>=dba@my-server-company.com <strong>--smtp-host<\/strong>=mail.my-server-company.com <strong>email_brief_report<\/strong><\/pre>\n<\/blockquote>\n<p>One should generally set up these parameters in the configuration file (aka <em>defaults file<\/em>) and forget all about it. mycheckpoint now has a default for the defaults file, which is <strong>\/etc\/mycheckpoint.cnf<\/strong>.<\/p>\n<p>Read more on the <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/emails\">emails documentation page<\/a>.<\/p>\n<h4>Revised HTML reports<\/h4>\n<ul>\n<li>The brief HTML reports has been updated, see <a href=\"http:\/\/code.openark.org\/forge\/wp-content\/uploads\/2010\/03\/mycheckpoint-brief-report-sample-113.html\">sample<\/a>.<\/li>\n<li>An HTML 24\/7 report as been added, see <a href=\"..\/..\/forge\/wp-content\/uploads\/2010\/03\/mycheckpoint-24-7-report-sample-107.html\">sample<\/a>. This report shows the distribution of popular metrics throughout the weekdays and hours.<\/li>\n<\/ul>\n<p>Full HTML reports remain slow to load. I&#8217;m putting some work into this, but I&#8217;m not sure I can work around the optimizer&#8217;s limitations of using indexes for GROUPing through views.<\/p>\n<h4>Updated documentation<\/h4>\n<p>The documentation has been revised, with more details put into the pages. Since <em>mycheckpoint<\/em> gains more and more features, I saw fit to write a <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/quick-howto\">Quick HOWTO<\/a> page which gets you up to speed, no fuss around, with <em>mycheckpoint<\/em>&#8216;s usage and features.<\/p>\n<p>Read the mycheckpoint <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/quick-howto\">Quick HOWTO<\/a> here.<\/p>\n<h4>Future plans<\/h4>\n<p>Work is going on. These are the non-scheduled future tasks I see:<\/p>\n<ul>\n<li>Custom monitoring + notifications. See my <a href=\"http:\/\/code.openark.org\/blog\/mysql\/things-to-monitor-on-mysql-the-users-perspective\">earlier post<\/a>.<\/li>\n<li>Monitoring InnoDB Plugin &amp; XtraDB status.<\/li>\n<li>PROCESSLIST dump on alerts.<\/li>\n<li>Interactive charts. See my <a href=\"http:\/\/code.openark.org\/blog\/mysql\/static-charts-vs-interactive-charts\">earlier post<\/a>.<\/li>\n<li>A proper <em>man<\/em> page&#8230;<\/li>\n<\/ul>\n<h4>Try it out<\/h4>\n<p>Try out <em>mycheckpoint<\/em>. It&#8217;s a different kind of monitoring solution. It does not require to to have a web server or complicated dependencies. To the experienced DBA it can further provide with valuable, raw or digested information in the form of SQL accessible data. I have used it to find anomalies in passing months, doing SQL search for periods of time where several conditions applied &#8212; it really gives you some extra power.<\/p>\n<ul>\n<li>Download mycheckpoint <a href=\"https:\/\/code.google.com\/p\/mycheckpoint\/\">here<\/a><\/li>\n<li>Visit the project&#8217;s <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\">homepage<\/a><\/li>\n<li>Browse the <a href=\"http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\">documentation<\/a><\/li>\n<li>Report <a href=\"https:\/\/code.google.com\/p\/mycheckpoint\/issues\/list\">bugs<\/a><\/li>\n<\/ul>\n<p><em>mycheckpoint<\/em> is released under the <a href=\"http:\/\/www.opensource.org\/licenses\/bsd-license.php\">New BSD License<\/a>.<\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 855px; width: 1px; height: 1px;\">http:\/\/code.openark.org\/forge\/mycheckpoint\/documentation\/quick-howto<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Revision 118 of mycheckpoint has been released. New and updated in this revision: Conditional alerts Email notifications Revised HTML reports, including 24\/7 reports. Updated documentation With this new revision mycheckpoint turns into a monitoring solution for MySQL. One can now: Store measure metrics Query for raw, aggregated or digested metrics Generate charts for selected metrics [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[5],"tags":[46,49,31],"class_list":["post-2221","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-monitoring","tag-mycheckpoint","tag-python"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bZZp-zP","_links":{"self":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/2221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/comments?post=2221"}],"version-history":[{"count":57,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/2221\/revisions"}],"predecessor-version":[{"id":2483,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/2221\/revisions\/2483"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/media?parent=2221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/categories?post=2221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/tags?post=2221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}