Ad Widget

Collapse

Zabbix MySQL Checks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tim.May
    Junior Member
    • Nov 2013
    • 9

    #1

    Zabbix MySQL Checks

    Hi All,

    Was hoping that someone might be able to help us please ?

    We have recently moved our DB from the same server that Zabbix was running on to a seperate server specifically for the DB.

    Prior to moving the DB we were able to use the following user parameters to query DB statistics:

    UserParameter=DBSize,mysqlshow -uOmitted-pOmitted --status zabbix | cut -d\| -f 8,10 -s --output-delimiter="|" | awk -F"|" '{ total = total+$1+$2 } END {print total}'
    UserParameter=DBUptime,mysqladmin -uOmitted -pOmitted status|cut -f2 -d":"|cut -f2 -d" "
    UserParameter=DBThreads,mysqladmin -uOmitted -pOmitted status|cut -f3 -d":"|cut -f2 -d" "
    UserParameter=DBQuestions,mysqladmin -uOmitted -pOmitted status|cut -f4 -d":"|cut -f2 -d" "
    UserParameter=DBSlowQueries,mysqladmin -uOmitted -pOmitted status|cut -f5 -d":"|cut -f2 -d" "
    UserParameter=DBQPS,mysqladmin -uOmitted -pOmitted status|cut -f9 -d":"|cut -f2 -d"

    All of these parameters worked without fault, and were returning values as expected.

    When we built the DB server, we installed the agent (version 2.2) and added the same checks to the Agent Config file, however Zabbix now errors with the below:

    Received value [] is not suitable for value type [Numeric (unsigned)] and data type [Decimal

    We have investigated the agent logs and are receiving the following error, in the active checks section:

    mysqlshow: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

    We are not sure if this error is related to why we are not receiving any data in Zabbix, but thought it best to include as much information here as possible.

    If anyone has any advice or help on why this might be happening, it would be greatly received.

    Thanks

    Tim
  • Tim.May
    Junior Member
    • Nov 2013
    • 9

    #2
    Further Information

    Hi All,

    We have been continuing to work on this, and have now discovered that when we execute a zabbix_get command from our Zabbix application server pointing to the DB server, we are getting the following error in the Agent Log file on the DB server:

    mysqlshow: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

    It would appear then that this is the root cause. We are continuing to investigate but as of yet not getting any resolution.

    Comment

    • ArtemK
      Senior Member
      • May 2013
      • 232

      #3
      Hi,

      check your audit logs. Maybe SELinux blocks access to mysql socket for zabbix agent

      Comment

      • aib
        Senior Member
        • Jan 2014
        • 1615

        #4
        I'm sorry for obvious question did you do any changes in /etc/my.cnf file after you " moved our DB from the same server that Zabbix was running on to a seperate server specifically for the DB."

        Because on my Zabbix server I have this line in /etc/my.cnf file
        Code:
        socket=/var/lib/mysql/mysql.sock
        Which was described in MySql documentation:
        Code:
         this can be a fully qualified path to MySQL socket filename. With this configuration, the Unix socket will be used instead of TCP/IP socket.
        And if you move your DB server on different computer you cannot use the same UNIX socket to connect to DB. You have to use TCP/IP socket.
        Something like that
        Code:
        [mysqld]
        host=host_name
        user=user_name
        password=your_pass
        Sincerely yours,
        Aleksey

        Comment

        Working...