Skip to content

Instantly share code, notes, and snippets.

@fujiwara
Created December 12, 2014 06:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujiwara/9b8456d3a795f18320be to your computer and use it in GitHub Desktop.
Save fujiwara/9b8456d3a795f18320be to your computer and use it in GitHub Desktop.
An example for your zabbix trapper daemon.
package main
import (
"log"
"github.com/fujiwara/go-zabbix-get/zabbix"
)
func main() {
err := zabbix.RunTrapperServer(
"127.0.0.1:10051",
func(req zabbix.TrapperRequest) (res zabbix.TrapperResponse, err error) {
log.Printf("%#v", req)
res.Proceeded = len(req.Data)
return res, nil
},
)
if err != nil {
panic(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment