-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexey Dubkov
committed
Feb 26, 2015
1 parent
5a554e8
commit a5c2167
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
go-zabbix | ||
============================================================================== | ||
Golang package, implement zabbix sender protocol for send metrics to zabbix. | ||
|
||
Example: | ||
```go | ||
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) | ||
} | ||
``` |