You are here

Config file database label

Hi,

In the process of setting up the agent I was modifying the FromDualMySQLagent.conf and setting up the databases as in the documentation:

[your_first_db_name]

Type         = mysqld
Modules      = process mysql myisam innodb

The database name should of course be consistant with a hostname on the Zabbix server. I have gotten all this to work correctly.

I am wondering however, is there the ability to change the database name in the config file to a label and then as an option point it at a database name? Such as:

[db_label]

Database  = your_first_db_name
Type         = mysqld
Modules      = process mysql myisam innodb

The reason I ask is that we have multiple servers with the same database names as they are exact copies of one another because they are either main, failover or test servers.

It may just be the case that I have yet to find the correct documentation.

Thanks in advance for all time and effort put into this question.

Taxonomy upgrade extras: 

Hello Matthew, In the proposed way it does not work. In Zabbix a host name must be unique. What you call db_label is the Zabbix hostname. We have for our MaaS customers the following constellations:
  • Several companies
  • Master/Slave set-ups
  • Galera Cluster set-ups
  • Several MySQL instances (mysqld) per server.
We recommend to use the db_label as follows:
[Company.Server_name.Db_fantasy_name]
In your case you possibly can omit the Company tag. So we have:
[Server_A.Prod]

[Server_B.Failover]

[Server_C.Dev1]

[Server_D.Dev2]
I hope this helps you to reflect your organization good enough? Regards, Oli
olicomment

Hi Oli, You are describing exactly what I would like to do with the label. The issue is more about saying which database to monitor without having to rename our databases to the label's format. Cheers Matthew
matthewianmorgancomment

I just did a test and now understand what you are saying. I am able to label them in the following: [Server_label.database_name] This seems to work. Thanks heaps Matthew
matthewianmorgancomment