Exemple #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)
}
Exemple #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
}
Exemple #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
}
Exemple #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)
}
Exemple #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)
}
Exemple #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)
}
Exemple #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)
}
Exemple #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
}
Exemple #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)
}