title: monitoring MySQL slave status
body: <p>I'm using Nagios with the mysql_check_health pugin to monitor my MySQL databases. I need to be able to return a numeric value to my plugin from an sql query to tell me if the replicated database is up and running.
  so here is what I have...</p>
  
  <pre><code>SHOW GLOBAL STATUS like 'slave_running'     
  </code></pre>
  
  <p>will return:</p>
  
  <pre><code>Variable_name   Value
  Slave_running   OFF/ON
  </code></pre>
  
  <p>I need to retrun a numeric value from a simple query for the plugin, anyone have any ideas... my thought was to return 3-<code>LENGTH(Slave_running)</code> that would == 1 for ON 0 for off but having trouble using the return values in that way.</p>