From d46dc7e1ce5d00a70a532d1e5626ba07de65002f Mon Sep 17 00:00:00 2001 From: Daniel Czerwonk Date: Tue, 12 Dec 2017 16:00:28 +0100 Subject: [PATCH] removed device protocol since it does not generate routes --- main.go | 4 ---- metric_collector.go | 2 -- metrics/default_label_strategy.go | 2 -- parser/parser.go | 2 -- protocol/protocol.go | 1 - 5 files changed, 11 deletions(-) diff --git a/main.go b/main.go index fa72fc4..27d7dd6 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,6 @@ var ( enableOspf = flag.Bool("proto.ospf", true, "Enables metrics for protocol OSPF") enableKernel = flag.Bool("proto.kernel", true, "Enables metrics for protocol Kernel") enableStatic = flag.Bool("proto.static", true, "Enables metrics for protocol Static") - enableDevice = flag.Bool("proto.device", true, "Enables metrics for protocol Device") enableDirect = flag.Bool("proto.direct", true, "Enables metrics for protocol Direct") // pre bird 2.0 bird6Socket = flag.String("bird.socket6", "/var/run/bird6.ctl", "Socket to communicate with bird6 routing daemon (not compatible with -bird.v2)") @@ -128,9 +127,6 @@ func enabledProtocols() int { if *enableStatic { res |= protocol.Static } - if *enableDevice { - res |= protocol.Device - } if *enableDirect { res |= protocol.Direct } diff --git a/metric_collector.go b/metric_collector.go index be19c02..67a32b1 100644 --- a/metric_collector.go +++ b/metric_collector.go @@ -30,7 +30,6 @@ func exportersForLegacy() map[int][]metrics.MetricExporter { return map[int][]metrics.MetricExporter{ protocol.BGP: []metrics.MetricExporter{metrics.NewLegacyMetricExporter("bgp4_session", "bgp6_session", l)}, - protocol.Device: []metrics.MetricExporter{metrics.NewLegacyMetricExporter("device4", "device6", l)}, protocol.Direct: []metrics.MetricExporter{metrics.NewLegacyMetricExporter("direct4", "direct6", l)}, protocol.Kernel: []metrics.MetricExporter{metrics.NewLegacyMetricExporter("kernel4", "kernel6", l)}, protocol.OSPF: []metrics.MetricExporter{metrics.NewLegacyMetricExporter("ospf", "ospfv3", l), ospf.NewExporter("")}, @@ -44,7 +43,6 @@ func exportersForDefault() map[int][]metrics.MetricExporter { return map[int][]metrics.MetricExporter{ protocol.BGP: []metrics.MetricExporter{e}, - protocol.Device: []metrics.MetricExporter{e}, protocol.Direct: []metrics.MetricExporter{e}, protocol.Kernel: []metrics.MetricExporter{e}, protocol.OSPF: []metrics.MetricExporter{e, ospf.NewExporter("bird_")}, diff --git a/metrics/default_label_strategy.go b/metrics/default_label_strategy.go index 7174dc2..c29b565 100644 --- a/metrics/default_label_strategy.go +++ b/metrics/default_label_strategy.go @@ -28,8 +28,6 @@ func protoString(p *protocol.Protocol) string { return "Static" case protocol.Kernel: return "Kernel" - case protocol.Device: - return "Device" case protocol.Direct: return "Direct" } diff --git a/parser/parser.go b/parser/parser.go index f07ee49..07b9a81 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -102,8 +102,6 @@ func parseProto(val string) int { return protocol.OSPF case "Direct": return protocol.Direct - case "Device": - return protocol.Device case "Kernel": return protocol.Kernel case "Static": diff --git a/protocol/protocol.go b/protocol/protocol.go index 3a37d86..c929f18 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -7,7 +7,6 @@ const ( Kernel = 4 Static = 8 Direct = 16 - Device = 32 ) type Protocol struct {