nut

package module
v0.0.0-...-6a91d67 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 6 Imported by: 0

README

Package nut implements the Network UPS Tools network protocol.

This package only implements those functions necessary for the nut_exporter; it is therefore not complete.

Documentation

Overview

Package nut implements the Network UPS Tools network protocol.

This package only implements those functions necessary for the nut_exporter; it is therefore not complete.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

A Client wraps a connection to a NUT server.

func Dial

func Dial(addr string) (*Client, error)

Dial dials a NUT server using TCP. If the address does not contain a port number, it will default to 3493.

func NewClient

func NewClient(conn net.Conn) *Client

NewClient wraps an existing net.Conn.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection.

func (*Client) UPSs

func (c *Client) UPSs() ([]string, error)

UPSs returns a list of all UPSs on the server.

func (*Client) Variables

func (c *Client) Variables(ups string) (map[string]string, error)

Variables returns all variables and their values for a UPS.

Directories

Path Synopsis
cmd
nut_exporter
Command nut_exporter exports UPSs on one or more NUT servers to Prometheus.
Command nut_exporter exports UPSs on one or more NUT servers to Prometheus.
Package nutcollector implements a Prometheus collector for Network UPS Tools.
Package nutcollector implements a Prometheus collector for Network UPS Tools.

Jump to

Keyboard shortcuts

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