{"id":609,"date":"2013-01-28T15:03:29","date_gmt":"2013-01-28T14:03:29","guid":{"rendered":"http:\/\/elkano.org\/blog\/?p=609"},"modified":"2013-01-28T15:03:29","modified_gmt":"2013-01-28T14:03:29","slug":"nagios-plugin-for-checking-mysql-synchronization-state","status":"publish","type":"post","link":"https:\/\/elkano.org\/blog\/nagios-plugin-for-checking-mysql-synchronization-state\/","title":{"rendered":"Nagios plugin for checking mysql synchronization state"},"content":{"rendered":"<p>I want to share this simple nagios plugin for monitoring mysql slaves replications states:<\/p>\n<p><a href=\"http:\/\/elkano.org\/blog\/wp-content\/uploads\/2013\/01\/mysql_check.png\"><img loading=\"lazy\" src=\"http:\/\/elkano.org\/blog\/wp-content\/uploads\/2013\/01\/mysql_check-300x16.png\" alt=\"check_mysql_sync\" width=\"300\" height=\"16\" class=\"aligncenter size-medium wp-image-615\" srcset=\"https:\/\/elkano.org\/blog\/wp-content\/uploads\/2013\/01\/mysql_check-300x16.png 300w, https:\/\/elkano.org\/blog\/wp-content\/uploads\/2013\/01\/mysql_check-290x16.png 290w, https:\/\/elkano.org\/blog\/wp-content\/uploads\/2013\/01\/mysql_check-150x8.png 150w, https:\/\/elkano.org\/blog\/wp-content\/uploads\/2013\/01\/mysql_check.png 874w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This plugin can be downloaded <a href=\"http:\/\/elkano.org\/blog\/files\/check_mysql_sync.pl\" title=\"check_mysql_sync\">here<\/a>. To install copy this script to nagios plugins directory (\/usr\/lib\/nagios\/plugins\/). View script help for full options list:<\/p>\n<pre class=\"dontquote prettyprint lang-xml\">\r\n# \/usr\/lib\/nagios\/plugins\/check_mysql_sync.pl -h\r\n\r\nCheck mysql sync between master and slave for Nagios version 0.1\r\nUsage: \/usr\/lib\/nagios\/plugins\/check_mysql_sync.pl [-v] -H &lt;host&gt; -p &lt;port&gt; -l &lt;username&gt; -x &lt;password&gt; -w &lt;warn level&gt; -c &lt;crit level&gt;  [-V]\r\n-v, --verbose\r\n   print extra debugging information \r\n-h, --help\r\n   print this help message\r\n-H, --hostname=HOST\r\n   name or IP address of host to check\r\n-l, --login\r\n    username for mysql database (Default nagios)\r\n-x, --passwd=PASSWD\r\n   password\r\n-p, --port=PORT\r\n   MYSQL port (Default 3361)\r\n-w, --warn=INTEGER\r\n   warning level for seconds behind sync\r\n-c, --crit=INTEGER \r\n   critical level for seconds behind sync\r\n-V, --version\r\n   prints version number\r\n<\/pre>\n<p>Run this command in your mysql master for grant to nagios user the required privileges:<\/p>\n<pre class=\"dontquote prettyprint\"> GRANT PROCESS, REPLICATION CLIENT on *.*  TO &#039;nagios&#039;@&#039;192.168.1.25&#039; IDENTIFIED BY &#039;yourpass&#039;;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I want to share this simple nagios plugin for monitoring mysql slaves replications states: This plugin can be downloaded here. To install copy this script to nagios plugins directory (\/usr\/lib\/nagios\/plugins\/). View script help for full options list: # \/usr\/lib\/nagios\/plugins\/check_mysql_sync.pl -h Check mysql sync between master and slave for Nagios version 0.1 Usage: \/usr\/lib\/nagios\/plugins\/check_mysql_sync.pl [-v] -H [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[10,78,13],"_links":{"self":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/609"}],"collection":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/comments?post=609"}],"version-history":[{"count":26,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/609\/revisions"}],"predecessor-version":[{"id":637,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/609\/revisions\/637"}],"wp:attachment":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/media?parent=609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/categories?post=609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/tags?post=609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}