Go to file
2022-12-26 12:47:05 +03:00
go.mod add go.mod 2022-12-26 12:47:05 +03:00
LICENSE Initial commit 2015-02-26 01:43:52 -08:00
README.md Add README.md 2015-02-26 10:35:15 -08:00
zabbix_test.go a test added 2017-01-11 11:50:42 +01:00
zabbix.go error handling added 2017-01-11 11:50:26 +01:00

go-zabbix

Golang package, implement zabbix sender protocol for send metrics to zabbix.

Example:

package main

import (
    "time"
    . "github.com/blacked/go-zabbix"
)

const (
    defaultHost  = `localhost`
    defaultPort  = 10051
)

func main() {
    var metrics []*Metric
    metrics = append(metrics, NewMetric("localhost", "cpu", "1.22", time.Now().Unix()))
    metrics = append(metrics, NewMetric("localhost", "status", "OK"))

    // Create instance of Packet class
    packet := NewPacket(metrics)

    // Send packet to zabbix
    z := NewSender(defaultHost, defaultPort)
    z.Send(packet)
}