zabbix

package
v0.0.0-...-a7fb08b Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

README

#Zabbix module

original source from: https://github.com/adubkov/go-zabbix

The MIT License (MIT)

Copyright (c) 2015 Alexey Dubkov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

Documentation

Overview

Package implement zabbix sender protocol for send metrics to zabbix.

Index

Constants

This section is empty.

Variables

This section is empty.

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"`
}

Metric class.

func NewMetric

func NewMetric(host, key, value string, clock ...int64) *Metric

Metric class constructor.

type Packet

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

Packet class.

func NewPacket

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

Packet class cunstructor.

func (*Packet) DataLen

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

DataLen Packet class method, return 8 bytes with packet length in little endian order.

type Sender

type Sender struct {
	Addr string
}

Sender class.

func NewSender

func NewSender(addr string) *Sender

Sender class constructor.

func (*Sender) Send

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

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