[GO][EDIT] Added tls flag in config file

This commit is contained in:
2020-12-01 20:05:51 +01:00
parent d3285ba301
commit 3ccd8caa23
2 changed files with 3 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ import (
// Config represents the configuration for the exporter // Config represents the configuration for the exporter
type Config struct { type Config struct {
tls bool `yaml:"tls,omitempty"`
Devices []Device `yaml:"devices"` Devices []Device `yaml:"devices"`
Features struct { Features struct {
BGP bool `yaml:"bgp,omitempty"` BGP bool `yaml:"bgp,omitempty"`

View File

@@ -245,7 +245,8 @@ func collectorOptions() []collector.Option {
opts = append(opts, collector.WithTimeout(*timeout)) opts = append(opts, collector.WithTimeout(*timeout))
} }
if *tls { if *tls || cfg.tls {
fmt.printf("TLS activated\n");
opts = append(opts, collector.WithTLS(*insecure)) opts = append(opts, collector.WithTLS(*insecure))
} }