modbus

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter represents a Prometheus exporter converting modbus information retrieved from remote targets via TCP as Prometheus style metrics.

func NewExporter

func NewExporter(config config.Config) *Exporter

NewExporter returns a new modbus exporter.

func (*Exporter) GetConfig

func (e *Exporter) GetConfig() *config.Config

GetConfig loads the config file

func (*Exporter) Scrape

func (e *Exporter) Scrape(targetAddress string, subTarget byte, moduleName string) (prometheus.Gatherer, error)

Scrape scrapes the given target via TCP based on the configuration of the specified module returning a Prometheus gatherer with the resulting metrics.

type InsufficientRegistersError

type InsufficientRegistersError struct {
	// contains filtered or unexported fields
}

InsufficientRegistersError is returned in Parse() whenever not enough registers are provided for the given data type.

func (*InsufficientRegistersError) Error

Error implements the Golang error interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL