Ad Widget

Collapse

Does zabbix-server-2.2.1 support mysql 5.7 monitoring?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • derekxuxu
    Junior Member
    • Feb 2017
    • 10

    #1

    Does zabbix-server-2.2.1 support mysql 5.7 monitoring?

    Hi Zabbix,

    I have a MySql 5.7 and I installed zabbix 2.2 agent on it, also Zabbix server is 2.2. Does this version Zabbix 2.2 support to monitor MySql 5.7?

    Kind Regards,

    Derek
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #2
    Yes. All versions of zabbix support that.
    Unofficial Zabbix Expert
    Blog, Corporate Site

    Comment

    • derekxuxu
      Junior Member
      • Feb 2017
      • 10

      #3
      Thanks Brendon,

      I am new about zabbix. Recently I just deployed a zabbix agent to monitor MySQL 5.7, I configured the host and MySQL template in zabbix server. From the server, it looks like not working to ping the agent. Here is my test result.

      root@#zabbix_get -s 10.37.168.188 -p 10050 -k mysql.version
      mysql Ver 14.14 Distrib 5.7.15, for Linux (x86_64) using EditLine wrapper

      root@#zabbix_get -s 10.37.168.188 -p 10050 -k mysql.ping[derekx,zl65041]
      0

      MySQL server is up but return is 0. Any ideas for this? How to trouble shooting? The same setting, the server ping 5.1 agent mysql working.

      Kind Regards,

      Derek

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        How do you set UserParameter?
        Is not it like the following?

        Code:
        UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin ping | grep -c alive
        If so, the key argument has no meaning.
        It is effective on the command line below.

        Code:
        # zabbix_get -s 10.37.168.188 -p 10050 -k mysql.ping
        Also, have you set up connection information to connect to MySQL?

        If you need a password when running mysqladmin you will need to create .my.cnf under /var/lib/zabbix.

        ex.
        Code:
        [client]
        host = localhost
        user = zabbix
        password = password
        socket = /var/lib/mysql/mysql.sock

        Comment

        • derekxuxu
          Junior Member
          • Feb 2017
          • 10

          #5
          Thanks Atsushi for your help.

          Here is my userparameter_mysql.conf content.

          [root@w0575daaocstgdbslv01-v zabbix_agentd.d]# ls
          userparameter_mysql.conf

          UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin ping | grep -c alive

          Here is /var/lib/zabbix/.my.cnf content

          [client]
          host =localhost
          user =zabbix
          password =zabbix123
          socket = /var/lib/mysql/mysql.sock

          From localhost, mysqladmin result

          [root@w0575daaocstgdbslv01-v zabbix]# mysqladmin -uzabbix -pzabbix123 ping | grep -c alive
          mysqladmin: [Warning] Using a password on the command line interface can be insecure.
          1

          From zabbix server, MySQL.ping is still returning 0 as below,

          root@PROD e0100dazabmon01-v zabbix# zabbix_get -s 10.37.168.188 -p 10050 -k mysql.ping
          0

          Any ideas for this?

          Kind Regards,

          Derek

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            Please try execute mysqladmin without specifying account and password.

            ex.
            Code:
            # sudo -u zabbix mysqladmin ping | grep -c alive

            Comment

            • derekxuxu
              Junior Member
              • Feb 2017
              • 10

              #7
              Thanks Atsushi.

              Here is the output of the command,

              [root@w0575daaocstgdbslv01-v zabbix_agentd.d]# sudo -u zabbix mysqladmin ping | grep -c alive
              1

              But on the zabbix server, it still returns 0.

              root@PROD e0100dazabmon01-v zabbix# zabbix_get -s 10.37.168.188 -p 10050 -k mysql.ping
              0

              Any ideas for this?

              Kind Regards,

              Derek

              Comment

              • derekxuxu
                Junior Member
                • Feb 2017
                • 10

                #8
                Hi Zabbix experts,

                Can you help me out about this?

                On the zabbix agent side, mysqladmin ping is working with all users,

                [root@w0575daaocstgdbslv01-v zabbix_agentd.d]# sudo -u zabbix mysqladmin ping | grep -c alive
                1

                [root@w0575daaocstgdbslv01-v zabbix_agentd.d]# mysqladmin ping |grep -c alive
                1

                But on the zabbix server, it still returns 0.

                root@PROD e0100dazabmon01-v zabbix# zabbix_get -s 10.37.168.188 -p 10050 -k mysql.ping
                0

                Is this server config or version issue?

                zabbix version is 2.2 and target MySQL is 5.7.

                Kind Regards,

                Derek

                Comment

                • Atsushi
                  Senior Member
                  • Aug 2013
                  • 2028

                  #9
                  If Zabbix server and Zabbix agent are incorrectly set up, value should not be obtained.

                  Please check again whether the server that executed the mysqladmin command manually and the server that you specified when running the zabbix_get command are the same server.
                  After that, after temporarily changing the log mode of the Zabbix agent to the Debug level, try running the zabbix_get command from the Zabbix server.

                  By checking the logs, I think that Zabbix agents can accept requests from Zabbix servers and see what kind of processing results returned 0.

                  Comment

                  • derekxuxu
                    Junior Member
                    • Feb 2017
                    • 10

                    #10
                    Thanks for the reply.

                    mysqladmin is running on the zabbix agent side.

                    zabbix_get is running on the zabbix server side. They are the different hosts.

                    How can I change the zabbix agent into debug mode? Can you give me the detail setting?

                    Kind Regards,

                    Derek

                    Comment

                    • derekxuxu
                      Junior Member
                      • Feb 2017
                      • 10

                      #11
                      Hi Zabbix experts,

                      I changed zabbix debug mode into 1 and here is the output. It looks like mysqladmin connect to MySQL issue as below.

                      mysqladmin: connect to server at 'localhost' failed
                      error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)'
                      Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

                      my mysqladmin ping is working from manually run. But it failed from zabbix server call, any ideas for this?

                      Kind Regards,

                      Derek

                      Comment

                      • Atsushi
                        Senior Member
                        • Aug 2013
                        • 2028

                        #12
                        Since the value of errno seems to be 13, it is a matter of permission(Permission denined).
                        Have you enabled SELinux?

                        If you have enabled SELinux, you need to add the following permissions to the Zabbix agent.

                        - Connect to UNIX stream socket
                        - Opening and reading files in the directory '/var/lib'

                        Please set according to the security policy of your environment.

                        Comment

                        • derekxuxu
                          Junior Member
                          • Feb 2017
                          • 10

                          #13
                          Thanks Atsushi for your kind support.

                          Now the command is working as below after disable SElinux and return 1/0 when MySQL is up/down

                          root@PROD e0100dazabmon01-v zabbix# zabbix_get -s 10.37.168.188 -p 10050 -k mysql.ping
                          1

                          But in the zabbix_agentd.log, there are continuous

                          sh: 1qT5w: No such file or directory
                          sh: 1qT5w: No such file or directory
                          sh: 1qT5w: No such file or directory
                          sh: 1qT5w: No such file or directory
                          sh: 1qT5w: No such file or directory

                          Any ideas to resolve this issue?

                          Kind Regards,

                          Derek

                          Comment

                          Working...