zabbixsnd

package
v0.0.0-...-97b18e2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Header = []byte("ZBXD\x01")

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Host  string `json:"host"`
	Key   string `json:"key"`
	Value string `json:"value"`
	Clock int64  `json:"clock"`
}

type Packet

type Packet struct {
	Request string    `json:"request"`
	Data    []*Metric `json:"data"`
	Clock   int64     `json:"clock"`
}

func NewPacket

func NewPacket(data []*Metric, clock ...int64) *Packet

NewPacket creates new packet

func (*Packet) DataLen

func (p *Packet) DataLen() ([]byte, error)

DataLen Packet return 8 bytes with packet length in little endian order

type Sender

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

Sender sends data to zabbix Read more: https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/trapper

func New

func New(addr string) (*Sender, error)

New creates new sender

func (*Sender) Send

func (s *Sender) Send(packet *Packet) ([]byte, error)

Send method Sender class, send packet to zabbix

Jump to

Keyboard shortcuts

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