** Copyright (C) 2001-2025 Zabbix SIA
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
** 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 Affero General Public License for more details.
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
"golang.zabbix.com/sdk/errs"
"golang.zabbix.com/sdk/metric"
"golang.zabbix.com/sdk/plugin"
"golang.zabbix.com/sdk/uri"
keyConfig = "redis.config"
keySlowlog = "redis.slowlog.count"
uriDefaults = &uri.Defaults{Scheme: "tcp", Port: "6379"}
// Common params: [URI|Session][,Password][,User]
//nolint:gochecknoglobals
paramURI = metric.NewConnParam("URI", "URI to connect or session name.").
WithDefault(uriDefaults.Scheme + "://localhost:" + uriDefaults.Port).WithSession().
WithValidator(uri.URIValidator{Defaults: uriDefaults, AllowedSchemes: []string{"tcp", "unix"}})
paramPassword = metric.NewConnParam("Password", "Redis password.").WithDefault("").
WithValidator(metric.LenValidator{Max: &maxAuthPassLen})
paramUser = metric.NewConnParam("User", "Redis user.").WithDefault("default")
var metrics = metric.MetricSet{
keyConfig: metric.NewUnordered("Returns configuration parameters of Redis server.",
metric.NewParam("Pattern", "Glob-style pattern to filter configuration parameters.").
keyInfo: metric.NewUnordered("Returns output of INFO command.",
metric.NewParam("Section", "Section of information to return.").WithDefault("default"),