I would like to monitor the number of MySQL databases with Nagios. I've installed the official Nagios plugins.
I'm using 'check_mysql_query':
./check_nrpe -H 192.168.1.10 -c check_mysql_query
Nagios agent:
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
I had to add client credentials to 'my.cnf' file.
Questions:
Is there any better/secure solution for this?
What's the minimum MySQL required privileges to run this command:
select count(*) from information_schema.SCHEMATA where schema_name not in ('mysql','information_schema');
COUNT(*)-2
.