[]*metric.Param{paramURI, paramUsername, paramPassword, metric.NewParam("Master", "Master host."), paramTLSConnect, paramTLSCaFile, paramTLSCertFile,
** Copyright (C) 2001-2023 Zabbix SIA
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"git.zabbix.com/ap/plugin-support/metric"
"git.zabbix.com/ap/plugin-support/plugin"
"git.zabbix.com/ap/plugin-support/uri"
keyDatabasesDiscovery = "mysql.db.discovery"
keyDatabaseSize = "mysql.db.size"
keyReplicationDiscovery = "mysql.replication.discovery"
keyReplicationSlaveStatus = "mysql.replication.get_slave_status"
keyStatusVars = "mysql.get_status_variables"
keyVersion = "mysql.version"
// handlerFunc defines an interface must be implemented by handlers.
type handlerFunc func(ctx context.Context, conn MyClient,
params map[string]string, extraParams ...string) (res interface{}, err error)
// getHandlerFunc returns a handlerFunc related to a given key.
func getHandlerFunc(key string) handlerFunc {
case keyDatabasesDiscovery:
return databasesDiscoveryHandler
return databaseSizeHandler
case keyReplicationDiscovery:
return replicationDiscoveryHandler
case keyReplicationSlaveStatus:
return replicationSlaveStatusHandler