Example #1
0
func NewServerFromConfig(router *mux.Router) (*Server, error) {
	addr, port, err := config.GetHostPortAttributes("analyzer", "listen")
	if err != nil {
		logging.GetLogger().Error("Configuration error: %s", err.Error())
	}

	return NewServer(addr, port, router)
}
Example #2
0
func NewSFlowAgentFromConfig(u string, a *analyzer.Client, m *mappings.FlowMappingPipeline) (*SFlowAgent, error) {
	addr, port, err := config.GetHostPortAttributes("sflow", "listen")
	if err != nil {
		return nil, err
	}

	return NewSFlowAgent(u, addr, port, a, m), nil
}
Example #3
0
func NewServerFromConfig(s string, g *graph.Graph, router *mux.Router) (*Server, error) {
	addr, port, err := config.GetHostPortAttributes(s, "listen")
	if err != nil {
		return nil, errors.New("Configuration error: " + err.Error())
	}

	return NewServer(g, addr, port, router), nil
}
Example #4
0
func NewSFlowAgentFromConfig(g *graph.Graph) (*SFlowAgent, error) {
	addr, port, err := config.GetHostPortAttributes("sflow", "listen")
	if err != nil {
		return nil, err
	}

	return NewSFlowAgent(addr, port, g)
}
Example #5
0
func NewOvsMonitorFromConfig() *OvsMonitor {
	addr, port, err := config.GetHostPortAttributes("ovs", "ovsdb")
	if err != nil {
		logging.GetLogger().Error("Configuration error: %s", err.Error())
		return nil
	}

	return NewOvsMonitor(addr, port)
}
Example #6
0
func NewOvsdbProbeFromConfig(g *graph.Graph, n *graph.Node) *OvsdbProbe {
	addr, port, err := config.GetHostPortAttributes("ovs", "ovsdb")
	if err != nil {
		logging.GetLogger().Errorf("Configuration error: %s", err.Error())
		return nil
	}

	return NewOvsdbProbe(g, n, addr, port)
}
Example #7
0
func NewServerFromConfig(router *mux.Router) (*Server, error) {
	addr, port, err := config.GetHostPortAttributes("analyzer", "listen")
	if err != nil {
		logging.GetLogger().Errorf("Configuration error: %s", err.Error())
		return nil, err
	}

	embedEtcd := config.GetConfig().GetBool("etcd.embedded")

	return NewServer(addr, port, router, embedEtcd)
}
Example #8
0
func NewServerFromConfig(s string) (*Server, error) {
	auth, err := NewAuthenticationBackendFromConfig()
	if err != nil {
		return nil, err
	}

	addr, port, err := config.GetHostPortAttributes(s, "listen")
	if err != nil {
		return nil, errors.New("Configuration error: " + err.Error())
	}

	return NewServer(s, addr, port, auth), nil
}
Example #9
0
func NewSFlowProbeFromConfig(g *graph.Graph) (*SFlowProbe, error) {
	addr, port, err := config.GetHostPortAttributes("sflow", "listen")
	if err != nil {
		return nil, err
	}

	expire, err := config.GetConfig().Section("cache").Key("expire").Int()
	if err != nil {
		return nil, err
	}
	cleanup, err := config.GetConfig().Section("cache").Key("cleanup").Int()
	if err != nil {
		return nil, err
	}

	return NewSFlowProbe(addr, port, g, expire, cleanup)
}