我想用Nagios监视MySQL数据库的数量。 我已经安装了官方的Nagios插件。
我正在使用'check_mysql_query':
./check_nrpe -H 192.168.1.10 -c check_mysql_query
Nagios代理:
command[check_mysql_query]=/usr/lib64/nagios/plugins/check_mysql_query -d mysql -q "select count(*) from information_schema.SCHEMATA where schema_name not in ('mysql','information_schema');" -w 100 -c 150
我不得不将客户端凭据添加到“my.cnf”文件。
问题:
有没有更好的/安全的解决scheme呢?
运行此命令所需的最低MySQL权限是多less?
select count(*) from information_schema.SCHEMATA where schema_name not in ('mysql','information_schema');
COUNT(*)-2 。