Ad Widget

Collapse

mysql.ping ZBX_UNSUPPORTED

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PtY
    Junior Member
    • Mar 2014
    • 10

    #1

    mysql.ping ZBX_UNSUPPORTED

    Hi Guys,

    I have a Zabbix 2.2.2 server, and also run a zabbix_agentd on it. When try the

    zabbix_get -s 127.0.0.1 -k 'mysql.ping'

    I got the 'ZBX_UNSUPPORTED' answer. If I try other hosts what are have mysql, the answer is '1'. If I try this (with zabbix or root user privileges too):

    mysqladmin ping -u zabbix

    On the localhost, I geth the 'mysqld is alive' message.

    Any keys (e.g. 'agent.ping' or custom userscripts) are working fine, but just all of mysql items. The Zabbix database in the same mysql, so it's working...

    What did I miss?
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    On my Zabbix DB server, in /usr/local/etc I have these files:
    -rw-r-----. 1 zabbix zabbix 1711 Mar 11 2013 userparameter_mysql.conf
    -rw-r-----. 1 zabbix zabbix 6472 Oct 18 2012 zabbix_agentd.conf


    userparameter_mysql.conf is what needs to be configured for your MySql metrics to gather data. The top portion of that file explains how it needs to be configured. Here you can see my configuration, which I have changed from the (# commented) stock config:

    Code:
    # For all the following commands HOME should be set to the directory that has .my.cnf file with password information.
    
    # Flexible parameter to grab global variables. On the frontend side, use keys like mysql.status[Com_insert].
    # Key syntax is mysql.status[variable].
    #UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/data/mysql/zabbix mysql -N | awk '{print $$2}'
    UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/etc/ mysql -N | awk '{print $$2}'
    Then further down in that config file, I have a separate key for MySql ping as well as for the version:

    Code:
    #UserParameter=mysql.ping,HOME=/etc/ zabbix mysqladmin ping | grep -c alive
    UserParameter=mysql.ping,HOME=/etc/ mysqladmin ping | grep -c alive
    UserParameter=mysql.version,mysql -V
    Finally, in your zabbix_agentd.conf file on your Zabbix DB server, make sure this line is present to include userparameter_mysql.conf:

    Code:
    ### Option: Include
    #       You may include individual files or all files in a directory in the configuration file.
    #       Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time.
    #
    # Mandatory: no
    # Default:
    # Include=
    
    # Include=/usr/local/etc/zabbix_agentd.userparams.conf
    # Include=/usr/local/etc/zabbix_agentd.conf.d/
    Include=/usr/local/etc/userparameter_mysql.conf

    If you make any changes to the conf files, you must restart the agent process.

    Comment

    • PtY
      Junior Member
      • Mar 2014
      • 10

      #3
      Of course, it's my fault
      Thanks your suggestion, the mysql userscripts were missing from my built config directory, but they were found in other server
      Thanks again, it was my problem!

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Very welcome.

        Comment

        Working...