summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/apache/init.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/go/collectors/go.d.plugin/modules/apache/init.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/apache/init.go b/src/go/collectors/go.d.plugin/modules/apache/init.go
new file mode 100644
index 000000000..00fc9d7e6
--- /dev/null
+++ b/src/go/collectors/go.d.plugin/modules/apache/init.go
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+package apache
+
+import (
+ "errors"
+ "net/http"
+ "strings"
+
+ "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
+)
+
+func (a *Apache) validateConfig() error {
+ if a.URL == "" {
+ return errors.New("url not set")
+ }
+ if !strings.HasSuffix(a.URL, "?auto") {
+ return errors.New("invalid URL, should ends in '?auto'")
+ }
+ return nil
+}
+
+func (a *Apache) initHTTPClient() (*http.Client, error) {
+ return web.NewHTTPClient(a.Client)
+}