Ad Widget

Collapse

Proper MySQL/MariaDB Monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rickschneider17
    Junior Member
    • Oct 2018
    • 4

    #1

    Proper MySQL/MariaDB Monitoring

    I have Zabbix Server 4.0 running, and Zabbix Agents 3.4 or 4.0 running on a variety of servers, which are either Debian 7 or Debian 9, and MySQL version 5.5, 5.6, 5.7 and MariaDB version 10.1 in the environment.
    I looked on the forum and found some threads that were similar to what I have found, which are here:



    Now, I created the .my.cnf and specified the HOME in the userparameter_mysql.conf as specified, and also adjusted the ping to use the -s for the socket.

    This works, in that when I stop MySQL/MariaDB, I get the notification that its down, as expected.
    When I start MySQL/MariaDB back up however, I am never getting notified that the service is no longer down. It seems to never change the status from a problem to resolved.
    So, while its great that I am being notified the service is down, I also want to be notified that its back up, and have it marked as Resolved.
    Am I missing something here?
  • zux
    Member
    • Sep 2018
    • 93

    #2
    Do you have OK event generation enabled in trigger?
    Do you have Recovery operations enabled in actions?

    Comment

    • rickschneider17
      Junior Member
      • Oct 2018
      • 4

      #3
      OK event generation is set to Expression, which is the default.
      The default expressions is {Template DB MySQL:mysql.ping.last(0)}=0
      I at one point set it to be Recovery Expression and put the expressions as {Template DB MySQL:mysql.ping.last(0)}=1 but that didnt ever get the resolve back, after 6 hours of MySQL being back up.

      I did try a zabbix_get from the Zabbix server to the MySQL server (zabbix_get -s <mysql ip> -p <zabbix port> -k mysql.ping) and it returns 0 even though the MySQL on that server is up and running.
      So I think the remote check is wrong, as if I run the mysqladmin ping command on the MySQL box directly (essentially doing what the mysql.ping is supposed to be doing), it returns a 1.

      Comment

      • zux
        Member
        • Sep 2018
        • 93

        #4
        execute that command on the MySQL box from user zabbix

        Comment

        • rickschneider17
          Junior Member
          • Oct 2018
          • 4

          #5
          Having issues getting su/sudo to run the command as that user, but I have the .my.cnf file set with the correct username/password to connect as, and the HOME=/etc/zabbix so shouldnt that override trying to connect to the mysql as the zabbix user?
          UserParameter=mysql.ping,HOME=/etc/zabbix mysqladmin ping | grep -c alive

          Comment

          Working...