Ad Widget

Collapse

mysql items not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veehexx
    Junior Member
    • Jan 2018
    • 5

    #1

    mysql items not working

    I've attempted to configure mysql checks with zabbix, using the built-in checks, and followed various guides on configuring them.
    i'm still struggling to get it working.

    long story short, if i run a test on the sql server, then i get results.
    zabbix_agentd -t "mysql.status[Bytes_sent]"
    mysql.status[Bytes_sent] [t|944637332]
    via the zabbix server to that host (mysql runs on a different server than zabbix), results in 1 of 4 errors:
    most of the mysql checks get
    "cannot convert value to numeric type"
    slow queries gets
    "Value "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)" of type "string" is not suitable for value type "Numeric (unsigned)""
    mysql.ping gets
    Value "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!
    0" of type "string" is not suitable for value type "Numeric (unsigned)"
    and mysql uptime gets
    Value "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)" of type "string" is not suitable for value type "Numeric (unsigned)"
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    You need to configure it to be able to connect to the MySQL server using the Zabbix user on the OS.
    For example, create .my.cnf in the Zabbix user's home directory.

    /var/lib/zabbix/.my.cnf
    Code:
    [client]
    user = zabbix
    password = password

    Comment

    • veehexx
      Junior Member
      • Jan 2018
      • 5

      #3
      and thats done on the a zabbix client and not the zabbix server (in this case, the mysql server)?
      Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.


      the mysql checks are assigned to the mySQL server host.

      still getting the same errors.

      Comment

      • veehexx
        Junior Member
        • Jan 2018
        • 5

        #4
        ...i forgot to add:
        if i ssh into mysql host, and run 'zabbix_agentd -t mysql.status[Bytes_received]', then i do get output.
        mysql.status[Bytes_received] [t|690856434]
        just the zabbix webui is showing an error on that entry of 'cannot convert value to numeric type'

        Comment

        • veehexx
          Junior Member
          • Jan 2018
          • 5

          #5
          got this sorted... SELinux getting in the way, on mysql server.

          I've not got as far as looking for a proper selinux rule for it, i've just gone for passive mode for testing which has got things working.

          Comment

          • cpotter
            Junior Member
            • Nov 2018
            • 3

            #6
            Originally posted by veehexx
            got this sorted... SELinux getting in the way, on mysql server.

            I've not got as far as looking for a proper selinux rule for it, i've just gone for passive mode for testing which has got things working.
            We have done :

            Code:
            # semodule -l | grep zabbix
            # semodule -e zabbix Perhaps it can help
            Best,

            Comment

            Working...