diff --git a/config/config.go b/config/config.go index 6dabc6c..3a29cba 100644 --- a/config/config.go +++ b/config/config.go @@ -9,6 +9,7 @@ import ( // Config represents the configuration for the exporter type Config struct { + tls bool `yaml:"tls,omitempty"` Devices []Device `yaml:"devices"` Features struct { BGP bool `yaml:"bgp,omitempty"` diff --git a/main.go b/main.go index 3adb4d0..cdec72c 100644 --- a/main.go +++ b/main.go @@ -245,7 +245,8 @@ func collectorOptions() []collector.Option { opts = append(opts, collector.WithTimeout(*timeout)) } - if *tls { + if *tls || cfg.tls { + fmt.printf("TLS activated\n"); opts = append(opts, collector.WithTLS(*insecure)) }