"modbus.get", "Returns a JSON array of the requested values, usage: modbus.get[endpoint,<slave id>,<function>,<address>,<count>,<type>,<endianness>,<offset>].")
** 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.
** We use the library go-modbus (goburrow/modbus), which is
** distributed under the terms of the 3-Clause BSD License
** available at https://github.com/goburrow/modbus/blob/master/LICENSE
"git.zabbix.com/ap/plugin-support/conf"
"git.zabbix.com/ap/plugin-support/plugin"
named "github.com/BurntSushi/locker"
"github.com/goburrow/modbus"
mblib "github.com/goburrow/modbus"
// Endpoint is a connection string consisting of a protocol scheme, a host address and a port or seral port name and attributes.
Endpoint string `conf:"optional"`
// SlaveID of modbus devices.
SlaveID string `conf:"optional"`
// Timeout of modbus devices.
Timeout int `conf:"optional"`
type PluginOptions struct {
// Timeout is the maximum time for waiting when a request has to be done. Default value equals the global timeout.
Timeout int `conf:"optional,range=1:30"`