Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there some plugin to monitoring database size in nagios? Of course i can write some bash script with query like:

SELECT table_schema \"DB Name\", sum( data_length + index_length ) / 1024 / 1024 \"DB Size in MB\" FROM information_schema.TABLES GROUP BY table_schema

But maybe there is some.

Thank you for help.

share|improve this question

1 Answer 1

Have a look at the check_mysql_query plugin:

check_mysql_query -H myserver -u mylogin -p mypassword -q "SELECT sum( data_length + index_length ) / 1024 / 1024 \"DB Size in MB\" FROM information_schema.TABLES GROUP BY table_schema" -w 200 -c 300

The SQL query (-q) can only return a single value and it must be numeric.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.