You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
398 B
22 lines
398 B
package zabbix |
|
|
|
import "testing" |
|
|
|
const ( |
|
hostname = `somehost.com` |
|
zabbixhost = `172.30.30.30` |
|
zabbixport = 1234 |
|
) |
|
|
|
func TestSend(t *testing.T) { |
|
sender := NewSender(zabbixhost, zabbixport) |
|
|
|
metrics := []*Metric{NewMetric(hostname, `key`, `value`)} |
|
_, err := sender.Send(NewPacket(metrics)) |
|
|
|
if err == nil { |
|
t.Error("sending should have failed") |
|
} |
|
|
|
t.Logf("error: %v", err.Error()) |
|
}
|
|
|