<p>If you don't specify a group or a file to read data from the plugin tries to read from several files that don't exist and no groups.</p>

<p>Here is an strace before this change:</p>

<p>stat("/etc/mysql/.cnf", 0x7fff7c4e6620) = -1 ENOENT (No such file or directory)<br>
stat("/etc/.cnf", 0x7fff7c4e6620)       = -1 ENOENT (No such file or directory)<br>
stat("/root/..cnf", 0x7fff7c4e6620)     = -1 ENOENT (No such file or directory)</p>

<p>Here is an strace after:</p>

<p>stat("/etc/mysql/my.cnf", 0x7fffea2dea40) = -1 ENOENT (No such file or directory)<br>
stat("/etc/my.cnf", {st_mode=S_IFREG|0644, st_size=1331, ...}) = 0<br>
open("/etc/my.cnf", O_RDONLY)           = 3</p>

<p>Even if you did specify a config file to read from bu no group was specified it is likely no group was used instead of using the default "client" group. All of this seems to be unintended behavior. </p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/awiddersheim/nagios-plugins fix_check_mysql_config_file</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/nagios-plugins/nagios-plugins/pull/1199'>https://github.com/nagios-plugins/nagios-plugins/pull/1199</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Fix check_mysql.c client options from file</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/nagios-plugins/nagios-plugins/pull/1199/files#diff-0">plugins/check_mysql.c</a>
    (6)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/nagios-plugins/nagios-plugins/pull/1199.patch'>https://github.com/nagios-plugins/nagios-plugins/pull/1199.patch</a></li>
  <li><a href='https://github.com/nagios-plugins/nagios-plugins/pull/1199.diff'>https://github.com/nagios-plugins/nagios-plugins/pull/1199.diff</a></li>
</ul>