MMM Community Blog Multi-Master Replication Manager for MySQL

28Oct/09Off

MMM Nagios plugin

There is a nagios plugin available on the MMM's google-code page, but if you didn't find it yet, here it is:

http://code.google.com/p/check-mysql-all/wiki/check_mmm

You can call this plugin over nrpe. I'm already working on to fork a version which more useful with passive checks.

This plugin was developed by Ryan Lowe (Percona).

Comments (10) Trackbacks (0)
  1. Hey Istvan,

    I’m working on one for zabbix. I was thinking of launchpad, maybe we can add it to mmm itself on launchpad?

  2. not a bad idea I think. I’m also writing a munin plugin (I know it’s wierd but everybody love drawing graphs right? :) ) )

  3. Istvan, no need to fork. Ping me on IRC & I’ll give you commit rights:)

  4. Istvan, Hi, I am really eager to get nagios monitoring my mmm deployment, but am running into a few snags. I have nrpe working properly and I can call check_mmm, but it always returns status ok no matter what. Any ideas?

  5. No matter what at all? Even when your MMM stopped?

    did you tried to set up the warning and critical levels?

    MMM plugin is designed to return OK(0) if its doesn’t find any problem.
    You can also try running with verbose option to see whats wrong.

    You are using mmm1 or mmm2?

  6. I have the same problem, we are running mmm2. When i run the check locally i get the following;

    [root@mmmmonitordev01 check-mysql-all]# /usr/lib64/nagios/plugins/check-mysql-all/check_mmm
    CRITICAL: db1(10.68.246.71) master/HARD_OFFLINE. Roles:

    Then when i run it via nrpe i get;

    [root@monitor01 ~]# /usr/local/nagios/libexec/check_nrpe -u -n -H 10.68.246.70 -c check_mmm
    OK

    Any ideas? Running in verbose mode does not show anything unusual.

  7. The issue for me was that the nrpe daemon, running as the nrpe user, did not have read access to the files in /etc/mysql-mmm/ . We chgrp’d them and now it works :)

    When the nrpe daemon runs the command and it can’t access the files config files it returns an ‘OK’. Maybe the code needs to be altered to not show OK if it can’t read the files??

    [root@mmmmonitordev01 ~]# cd /etc/mysql-mmm/
    [root@mmmmonitordev01 mysql-mmm]# ls -la
    total 36
    drwxr-xr-x 2 root root 4096 Jan 4 15:38 .
    drwxr-xr-x 84 root root 12288 Jan 7 14:37 ..
    -rw-r—– 1 root nrpe 33 Dec 21 15:13 mmm_agent.conf
    -rw-r—– 1 root nrpe 941 Jan 4 15:38 mmm_common.conf
    -rw-r—– 1 root nrpe 325 Jan 4 15:14 mmm_mon.conf
    -rw-r—– 1 root nrpe 1293 Dec 21 15:13 mmm_tools.conf

    These are the modifications we made to check_mmm

    #v1 ERROR Monitor message changed
    if ($mmm_output =~ /DAEMON IS NOT RUNNING/) {
    my $msg = “CRITICAL: MMM Daemon is not running”;
    report_error($msg, $ERRORS{‘CRITICAL’});
    }
    #v2 ERROR Monitor message changed
    if ($mmm_output =~ /ERROR: Can’t connect to monitor daemon/) {
    my $msg = “CRITICAL: MMM Monitor Daemon is not running”;
    report_error($msg, $ERRORS{‘CRITICAL’});
    }

    #mmm2 extend
    if ($mmm_output =~ m/passive/i) {
    my $msg = “CRITICAL: MMM Monitor Daemon is in passive mode”;
    report_error($msg, $ERRORS{‘WARNING’});
    }

    if ($mmm_output =~ m/agent/i) {
    my $msg = “CRITICAL: MMM Agent Daemon is NOT running on ALL DB’s in the cluster”;
    report_error($msg, $ERRORS{‘CRITICAL’});
    }

  8. @Josh

    Sorry for ignoring your comment so long. I have added the changes you made and committed the code.

    Thanks a lot. If you have any other patches, let us know!

    Istvan

  9. I am really eager to get nagios monitoring my mmm deployment, but am running into a few snags. I have nrpe working properly and I can call check_mmm, but it always returns status ok no matter what. Any ideas?

  10. Hello
    i have a question about check_mm. If i start that scrip on the mmm_control Server its ok but i start that script on my nagios server whith check_nrpe comes following message:CRITICAL: Cannot Find/Execute mmm_control

    I hope you can me help


Trackbacks are disabled.