I have installed zabbix server and it is monitoring an external mysql database. 1 server and 1 host. When I installed the templates for the mysql server the triggers show as "not supported". I REALLY need to get this working. I enabled them anyway (triggers) and of course I do not get any graph data. Any help in this area would really be appreciated. Thanks!!
Ad Widget
Collapse
Server Monitoring Mysql
Collapse
X
-
Tags: None
-
Zabbix Agent include string located in /usr/local/etc/userparameter_mysql.conf
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/var/lib/mysql/DBNAME mysql -N | awk '{print $$2}'
From /etc/zabbix/zabbix_agentd.conf
Include=/usr/local/etc/userparameter_mysql.conf
The agent version is 2.0.6_x86_64
Centos 5.9.Comment
-
Comment
-
So, your my.cnf file resides in /var/lib/mysql/DBNAME ? I have my.cnf in /etc so my userparameter statement looks like this: (No DB Name included)
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/etc/ mysql -N | awk '{print $$2}'
According to the top of that conf file:
# For all the following commands HOME should be set to the directory that has .my.cnf file with password information.Comment
-
I now have the string pointing to /etc. [home=/etc mydbnamehere -N | awk '{print $$2}']. In the zabbix.agent.log I am getting loads of these.
2392:20130506:161553.856 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.6 (revision 35158).
2392:20130506:161553.983 failed to add UserParameter "mysql.status[*]": duplicate key
2304:20130506:162135.426 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.6 (revision 35158).
2304:20130506:162135.433 failed to add UserParameter "mysql.status[*]": duplicate key
2317:20130506:165721.370 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.6 (revision 35158).
2317:20130506:165721.371 failed to add UserParameter "mysql.status[*]": duplicate key
2343:20130507:081844.394 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.6 (revision 35158).
2343:20130507:081844.423 failed to add UserParameter "mysql.status[*]": duplicate key
Is the agent supposed to be on all the time? If i start the service it starts with "OK" but if I check the status it is not running.Last edited by rstogsdill; 07-05-2013, 17:23.Comment
-
Agent should always be running.
"Duplicate key" is telling you that you have that userparameter somewhere else and it is trying to load it multiple times. Do you possibly have it in zabbix_agentd.conf also? It should only be one time in userparameter_mysql.confComment
-
Also note that your string is different than mine. I do not include the name of the DB in my string. I tried that and got errors. You are also missing "mysql" in your string just before the -N argument. And I am not sure if you need the trailing / after /etc.
Again, this is my string:
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/etc/ mysql -N | awk '{print $$2}'Comment
-
Hi,
i use this tutorial here for mysql and it's been working fine so far . You might want to give a try. if you go donw that path a lot more people here can help you . Link: https://www.zabbix.com/forum/showthread.php?t=26503Comment
-
ahh.. i thought the "mysql" should be the name of the database I wanted to monitor. This was a missunderstanding on my part. I will try a revised string and consult the link you provided. Thanks for your help!
On the duplicate string... this is from my Agentd
### 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=/usr/local/etc/userparameter_mysql.conf
Include=/etc/zabbix/zabbix_agentd.d/
# Include=/usr/local/etc/zabbix_agentd.userparams.conf
# Include=/usr/local/etc/zabbix_agentd.conf.d/
I still have the duplicate key error.
10051]
4834:20130507:105330.863 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.6 (revision 35158).
4834:20130507:105330.863 failed to add UserParameter "mysql.status[*]": duplicate keyComment
-
That's correct. But your agent is seeing a duplicate key somewhere. The usual place to put additional userparameters is in zabbix_agentd.conf. But since this specific key is in userparameter_mysql.conf, then it should not also be in zabbix_agentd.confComment
-
ahh.. i thought the "mysql" should be the name of the database I wanted to monitor. This was a missunderstanding on my part. I will try a revised string and consult the link you provided. Thanks for your help!
On the duplicate string... this is from my Agentd
### 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=/usr/local/etc/userparameter_mysql.conf
Include=/etc/zabbix/zabbix_agentd.d/
# Include=/usr/local/etc/zabbix_agentd.userparams.conf
# Include=/usr/local/etc/zabbix_agentd.conf.d/
I still have the duplicate key error.
10051]
4834:20130507:105330.863 Starting Zabbix Agent [Zabbix server]. Zabbix 2.0.6 (revision 35158).
4834:20130507:105330.863 failed to add UserParameter "mysql.status[*]": duplicate key
The reason the system sees a duplicate key is because you also have the MYSQL template linked to the server. One of the 2 has to be excluded.Comment
Comment