問題: 在本機上使用 # /usr/lib64/nagios/plugins/check_mysql -umysqluser -d test -pmysqlpass Uptime: 1074 Threads: 1 Questions: 1 Slow queries: 0 Opens: 14 Flush tables: 1 Open tables: 8 Queries per second avg: 0.0
可以得到正確的輸出
修改/etc/nagios/nrpe.cfg文件,配置下面命令: command=/usr/lib64/nagios/plugins/check_mysql -H localhost -u mysqluser -d test -p mysqlpass
然後使用check_nrpe執行此命令: # /usr/lib64/nagios/plugins/check_nrpe -H localhost -c check_mysql_1 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13)