I have a Munin script /etc/munin/plugins/mysql_replag that queries a MySQL server to check the status of a master-slave replication:#!/bin/sh# Plugin to monitor the Seconds_Behind_Master of replication on a MySQL slaveMYSQLOPTS=$mysqloptsMYSQL=${mysql:-mysql}if [ $1 = autoconf ]; then        $MYSQL --version 2>/dev/null >/dev/null        if [ $? -eq 0 ]        then                $MYSQL $MYSQLOPTS -e '' 2>/dev/null >/dev/null                if [ $? -eq 0 ]                then                        echo yes                        exit 0                else                        echo no (could not connect to mysql)                fi        else                echo no (mysql not found)        fi        exit 1fiif [ $1 = config ]; then        echo 'graph_title Replication lag'        echo 'graph_args --base 1000 -l 0'        echo 'graph_vlabel lag in secs'        echo 'graph_category mysql'        echo 'lag.label lag'        exit 0fi/usr/bin/printf lag.value mysql $MYSQLOPTS -e 'show slave status\G' | grep Seconds_Behind_Master | awk '{print $2}'The plugin config file is /etc/munin/plugin-conf.d/mysql_replag: (note: edited)[mysql_replag]user rootenv.mysqlopts -umyuser -pmyp4ssw0rd -h 10.13.13.13However, the plugin config file is apparently ignored when running the plugin:# munin-run mysql_replag lag.value ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)The plugin works when I remove the MySQL options from the config file and I specify them in the plugin directly via the $MYSQLOPTS variable. Why is the config file ignored?
Why is the config file in /etc/munin/plugin-conf.d/ ignored?
mysql;munin
Variables in munin are declared using env.myvariable, not env.var myvariable; try this:env.mysqlopts -umyuser -pmyp4ssw0rd -h 10.13.13.13