Ad Widget

Collapse

Template DB MySQL by Zabbix - MySQL: Service is down

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sara.Art
    Member
    • Jun 2020
    • 52

    #1

    Template DB MySQL by Zabbix - MySQL: Service is down

    Hi! I recently installed the Template DB MySQL by Zabbix to monitor sql (mariadb) on a linux machine but the trigger tells me that mysql service is down (instead it works). I checked the configuration and seems ok. Surely I did something wrong but I can't find what.

    Please, could You help me? Many thanks! Sara
  • isaqueprofeta
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Aug 2020
    • 154

    #2
    Did you follow the instructions to use it?

    Requirements for template operation:
    1.Install Zabbix agent and MySQL client.
    2.Copy Template_DB_MySQL.conf into folder with Zabbix agent configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget restart zabbix-agent.
    3.Create MySQL user for monitoring. For example:
    CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';
    GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
    For more information read the MYSQL documentation https://dev.mysql.com/doc/refman/8.0/en/grant.html , please.
    4.Create .my.cnf in home directory of Zabbix agent for Linux (/var/lib/zabbix by default ) or my.cnf in c:\ for Windows. For example:
    [client]
    user=zbx_monitor
    password=<password>
    And remember that you need two macros for it to work:
    • MySQL status: mysql.ping["{$MYSQL.HOST}","{$MYSQL.PORT}"]

    Comment

    • Sara.Art
      Member
      • Jun 2020
      • 52

      #3
      Hi Isaque! And many thanks for Your reply! Well, I already followed the instructions but I still have the problem. Speaking about the macros, I see them in my inherited and host macros, and their values are localhost and 3306. What am I missing? Thanks again for Your support :-) Sara

      Comment

      • isaqueprofeta
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Aug 2020
        • 154

        #4
        localhost Looks like is pretty much the problem here, you need to set it to the ip address of the monitored host.

        Maybe setting your macro to {$MYSQL.HOST} = {HOST.IP} could work, or just put your IP like {$MYSQL.HOST} = 10.10.10.1 (change 10.10.10.1 to the ip of monitored host) or something like that.

        Comment

        • Sara.Art
          Member
          • Jun 2020
          • 52

          #5
          Hi Isaque, I tried but the problem is stll there; should I config something inside the file "Template_DB_MySQL.conf "? many thanks again! Sara

          Comment

          • isaqueprofeta
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Aug 2020
            • 154

            #6
            Did you saw that are some instructions inside Template_DB_MySQL.conf?

            Code:
            #For OS Linux: You need create .my.cnf in zabbix-agent home directory (/var/lib/zabbix by default)
            #For OS Windows: You need add PATH to mysql and mysqladmin and create my.cnf in %WINDIR%\my.cnf,C:\my.cnf,BASEDIR\my.cnf https://dev.mysql.com/doc/refman/5.7/en/option-files.html
            #The file must have three strings:
            #[client]
            #user='zbx_monitor'
            #password='<password>'

            Comment

            • Sara.Art
              Member
              • Jun 2020
              • 52

              #7
              Hi! Yes, I see there are other lines, should I customize them or not?

              Comment

              • isaqueprofeta
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Aug 2020
                • 154

                #8
                The other lines no. Just create the "my.cnf" with the credential data. And if it still not working, give me some logs and screenshots to better understanding.

                Comment

                • Sara.Art
                  Member
                  • Jun 2020
                  • 52

                  #9
                  Hi Isaque, which logs and screenshot do You need? :-) many thanks and have a nice day, Sara

                  Comment

                  • isaqueprofeta
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Aug 2020
                    • 154

                    #10
                    Originally posted by Sara.Art
                    Hi Isaque, which logs and screenshot do You need? :-) many thanks and have a nice day, Sara
                    The latest data on the trigger items from "mysql service is down"

                    Comment

                    • Sara.Art
                      Member
                      • Jun 2020
                      • 52

                      #11
                      Good morning Isaque,
                      here there are the latest data about SQL, hope I'm posting what You asked for. Many thanks and have a nice day, Sara

                      MySQL (40 Items)

                      MySQL: Aborted clients per second
                      2020-09-02 08:42:31 0 Graph

                      MySQL: Aborted connections per second
                      2020-09-02 08:42:31 0.01669 +0.00004499 Graph

                      MySQL: Buffer pool efficiency
                      2020-09-02 08:42:29 0.0009391 % -0.00000002138 % Graph

                      MySQL: Buffer pool utilization
                      2020-09-02 08:42:30 99.9039 % +0.01144 % Graph

                      MySQL: Bytes received
                      2020-09-02 08:42:31 10.86 KBps -1.08 KBps Graph

                      MySQL: Bytes sent
                      2020-09-02 08:42:31 10.64 KBps -41.27 KBps Graph

                      MySQL: Command Delete per second
                      2020-09-02 08:42:31 0.01669 +0.01669 Graph

                      MySQL: Command Insert per second
                      2020-09-02 08:42:31 11.0814 -1.6012 Graph

                      MySQL: Command Select per second
                      2020-09-02 08:42:31 10.3972 -0.7875 Graph

                      MySQL: Command Update per second
                      2020-09-02 08:42:31 1.502 -0.06253 Graph

                      MySQL: Connections per second
                      2020-09-02 08:42:31 0.1168 +0.08353 Graph

                      MySQL: Created tmp files on disk
                      2020-09-02 08:42:31 30 Graph

                      MySQL: Created tmp files on disk per second
                      2020-09-02 08:42:31 0 Graph

                      MySQL: Created tmp tables on disk
                      2020-09-02 08:42:31 2588 Graph

                      MySQL: Created tmp tables on disk per second
                      2020-09-02 08:42:31 0 Graph

                      MySQL: Created tmp tables on memory
                      2020-09-02 08:42:31 92346 +7 Graph

                      MySQL: Created tmp tables on memory per second
                      2020-09-02 08:42:31 0.1168 +0.01696 Graph

                      MySQL: InnoDB buffer pool pages free
                      2020-09-02 08:42:31 115 -11 Graph

                      MySQL: InnoDB buffer pool pages total
                      2020-09-02 08:05:31 131070 Graph

                      MySQL: InnoDB buffer pool read requests per second
                      2020-09-02 08:42:31 753.5876 -1439.881 Graph

                      MySQL: InnoDB buffer pool reads per second
                      2020-09-02 08:42:31 0 Graph

                      MySQL: InnoDB row lock time
                      2020-09-02 08:05:31 2ms Graph

                      MySQL: InnoDB row lock time max
                      2020-09-02 08:05:31 2ms Graph

                      MySQL: InnoDB row lock waits
                      2020-09-02 08:42:31 1 Graph

                      MySQL: Max used connections
                      2020-09-02 08:05:31 37 Graph

                      MySQL: Queries per second
                      2020-09-02 08:42:31 38.301 -4.6736 Graph

                      MySQL: Questions per second
                      2020-09-02 08:42:31 38.301 -4.6736 Graph

                      MySQL: Size of database MACHINE NAME
                      2020-09-02 08:07:22 19.4 KB Graph

                      MySQL: Size of database mysql
                      2020-09-02 08:07:23 643.33 KB Graph

                      MySQL: Size of database performance_schema
                      2020-09-02 08:07:24 0 B Graph

                      MySQL: Size of database Syslog
                      2020-09-02 07:52:21 510.8 MB Graph

                      MySQL: Size of database zabbix
                      2020-09-02 08:42:25 48.13 MB +2.02 MB Graph

                      MySQL: Slow queries per second
                      2020-09-02 08:42:31 0 Graph

                      MySQL: Status
                      2020-09-02 08:34:32 Down (0) Graph

                      MySQL: Threads cached
                      2020-09-02 08:42:31 6 Graph

                      MySQL: Threads connected
                      2020-09-02 08:42:31 31 Graph

                      MySQL: Threads created
                      2020-09-02 08:42:31 37 Graph

                      MySQL: Threads created per second
                      2020-09-02 08:42:31 0 Graph

                      MySQL: Threads running
                      2020-09-02 08:42:31 1 Graph

                      MySQL: Uptime
                      2020-09-02 08:42:31 34 days, 15:00:23 +00:01:00 Graph

                      Comment

                      • isaqueprofeta
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Aug 2020
                        • 154

                        #12
                        Oh well, seems to me that your MySQL monitoring is all right... But since you're using ODBC (looking at the items you're showing me) this template has items using Database DSN, and you're probably missing this config (So the status is Down and there are two missing items)

                        So, first I'd like you to review these docs: https://www.zabbix.com/documentation...es/odbc_checks

                        And then you gonna want to configure your DSN as a macro like this:
                        Code:
                        {$MYSQL.DSN} = "Driver=/usr/local/lib/libmyodbc5a.so;Database=zabbix;Server=127.0.0.1;Port=3306"
                        Try that out and let me know.

                        Comment

                        • Sara.Art
                          Member
                          • Jun 2020
                          • 52

                          #13
                          Hi Isaque, at the end I chose a "quicker solution", this trigger:
                          {Hostname:mysql.uptime.last(#3,300)}=0
                          works fine

                          Many thanks!
                          Sara

                          Comment

                          Working...