** 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/agent2/internal/agent/scheduler"
"golang.zabbix.com/sdk/errs"
"golang.zabbix.com/sdk/plugin"
clients map[plugin.ResultWriter][]*scheduler.Request
type watchRequest struct {
requests []*scheduler.Request
err := plugin.RegisterMetrics(&impl, "DebugLog", "debug.log", "Returns timestamp each second.")
panic(errs.Wrap(err, "failed to register metrics"))
p.Debugf("activating plugin")
ticker := time.NewTicker(time.Second)
for sink, requests := range p.clients {
for _, r := range requests {
value := now.Format(time.Stamp)
lastlogsize := uint64(now.UnixNano())
sink.Write(&plugin.Result{
LastLogsize: &lastlogsize,