Icinga2 monitor Database Table Size

This forum was archived to /woltlab and is now in read-only mode.
  • Hello every one, i have a issue. I want to monitor database table size ( Mysql database ), like this http://prntscr.com/bxz5uq . However i cann't find any check command or plugin for this. I read some tutorials about using nagios plugin to monitor database table size ( following this link https://exchange.nagios.org/di…abase-With-Nagios/details ), i try to follow but still failure, and i think it is for pure nagios nrpe.
    So, if anyone have a idea about monitoring database table size pls support me. Alot of thanks !!!

  • I'd go for check_mysql_health and use a custom query calculating the table size for a given parameter.

    The CheckCommand definition for mysql_health is available inside the ITL when using "include <plugins-contrib>" in your icinga2.conf already.

    I just needed a different topic than to always hunt bugs in Icinga 2 so I've created a working example. Blogpost and Vagrant box update will follow tomorrow.

    The trick is to understand the plugin parameters, find/create a CheckCommand definition, and then integrate that with a well known strategy for hosts and services in a dynamic fashion (aka I don't like service objects but generated service objects from host dictionaries).

    Generic apply for rule:

    Host definition for the database server to match the apply for rule:

    1. /* database checks */
    2. vars.databases["icinga"] = {
    3. mysql_health_warning = 4096 //MB
    4. mysql_health_critical = 8192 //MB
    5. }
    6. vars.databases["icingaweb2"] = {
    7. mysql_health_warning = 4096 //MB
    8. mysql_health_critical = 8192 //MB
    9. }

    View in Icinga Web 2: