Ad Widget

Collapse

[V2.0.4] Issue with MySQL template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix_es
    Senior Member
    • Apr 2007
    • 153

    #1

    [V2.0.4] Issue with MySQL template

    Hello:
    I have a strange issue with MySQL Template in zabbix 2.0.4.
    I have added a new item almost identical to mysql.status[*]:

    # 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[*],/bin/echo "show global status where Variable_name='$1';" | /usr/bin/mysql -uzabbix -ppassword -N | /usr/bin/awk '{print $$2}'

    but with mysql.variables[*]

    UserParameter=mysql.variable[*],/bin/echo "show global variables where Variable_name='$1';" | /usr/bin/mysql -uzabbix -ppassword -N | /usr/bin/awk '{print $$2}'

    But zabbix_agent not recognizes it

    I have test with mysq.variables[max_connections] with user zabbix_agent:

    salmon:~ # su - zabbix_agent
    salmon:~> whoami
    zabbix_agent
    salmon:~> echo $SHELL
    /bin/sh
    salmon:~> /bin/echo "show global variables where Variable_name='max_connections';" | /usr/bin/mysql -uzabbix -ppassword -N | /usr/bin/awk '{print $2}'
    75
    salmon:~>
    salmon:~> zabbix_get -s localhost -k mysql.variables[max_connections]
    ZBX_NOTSUPPORTED
    salmon:~> zabbix_get -s localhost -k mysql.status[max_used_connections]
    31

    Why??
  • zabbix_es
    Senior Member
    • Apr 2007
    • 153

    #2
    Sorry I mean mysql.variable[*] and not mysql.variables[*].
    I have test with mysql.variable[max_connections] so replace all "mysql.variables" by "mysql.variable" in my earlier post.

    Comment

    • zabbix_es
      Senior Member
      • Apr 2007
      • 153

      #3
      You are subscribed to this thread [V2.0.4] Issue with MySQL template : Fixed

      Here is the log:
      First time, I installed zabbix 2.0.4 from source, compiling with default options, so, configuration files are in /usr/local/etc.

      After that, I uninstalled and reconfigure zabbix with option --sysconfdir="/etc/zabbix" and remaked and reinstalled it again.
      When I reinstalled I checked that configuration files were in /etc/zabbix.
      Then I added new item zabbix.variables[*] and zabbix complain with “unsuported item” but the reason was that zabbix_agent was reading old configuration file from /usr/local/etc and not new one from /etc/zabbix so I am going to open a new thread with this issue.

      To fix wrong configuration file in startup I must use

      -c "/etc/zabbix/zabbix_agentd.conf"

      option in startup file in /etc/init.d/zabbix_agentd
      After do that, zabbix_agentd read rigth configuration file and works fine.

      Best regards!.

      Comment

      Working...