[GO][EDIT] Added tls flag in config file
This commit is contained in:
@@ -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"`
|
||||||
|
|||||||
3
main.go
3
main.go
@@ -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))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user