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