Ejemplo n.º 1
0
// init is a mandatory initialization function which must be used exclusively to register Zabbix
// module function handlers. It is called when Zabbix calls `dlopen()` to load this Go module.
//
// No other work should be performed in this function. All other initialization activities should
// be executed with an InitHandlerFunc.
func init() {
	g2z.RegisterInitHandler(InitModule)
	g2z.RegisterUninitHandler(UninitModule)

	g2z.RegisterUint64Item("go.ping", "", Ping)
	g2z.RegisterStringItem("go.echo", "Hello,world!", Echo)
	g2z.RegisterDoubleItem("go.random", "0,100", Random)
	g2z.RegisterDiscoveryItem("go.cpu.discovery", "", DiscoverCpus)
	g2z.RegisterStringItem("go.version", "", Version)
}
Ejemplo n.º 2
0
func init() {
	g2z.RegisterInitHandler(MyInitFunc)
}