diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/x509check/init.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/x509check/init.go b/src/go/collectors/go.d.plugin/modules/x509check/init.go new file mode 100644 index 000000000..f0df7fdef --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/x509check/init.go @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package x509check + +import ( + "errors" + + "github.com/netdata/netdata/go/go.d.plugin/agent/module" +) + +func (x *X509Check) validateConfig() error { + if x.Source == "" { + return errors.New("source is not set") + } + return nil +} + +func (x *X509Check) initProvider() (provider, error) { + return newProvider(x.Config) +} + +func (x *X509Check) initCharts() *module.Charts { + var charts *module.Charts + if x.CheckRevocation { + charts = withRevocationCharts.Copy() + } else { + charts = baseCharts.Copy() + } + + for _, chart := range *charts { + chart.Labels = []module.Label{ + {Key: "source", Value: x.Source}, + } + } + + return charts + +} |