summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/pihole/collect.go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 08:15:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 08:15:20 +0000
commit87d772a7d708fec12f48cd8adc0dedff6e1025da (patch)
tree1fee344c64cc3f43074a01981e21126c8482a522 /src/go/collectors/go.d.plugin/modules/pihole/collect.go
parentAdding upstream version 1.46.3. (diff)
downloadnetdata-upstream.tar.xz
netdata-upstream.zip
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/go/plugin/go.d/modules/pihole/collect.go (renamed from src/go/collectors/go.d.plugin/modules/pihole/collect.go)14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/pihole/collect.go b/src/go/plugin/go.d/modules/pihole/collect.go
index ab0e48ff0..c9e6d8451 100644
--- a/src/go/collectors/go.d.plugin/modules/pihole/collect.go
+++ b/src/go/plugin/go.d/modules/pihole/collect.go
@@ -12,7 +12,7 @@ import (
"sync"
"time"
- "github.com/netdata/netdata/go/go.d.plugin/pkg/web"
+ "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web"
)
const wantAPIVersion = 3
@@ -131,13 +131,12 @@ func (p *Pihole) queryMetrics(pmx *piholeMetrics, doConcurrently bool) {
}
func (p *Pihole) querySummary(pmx *piholeMetrics) {
- req, err := web.NewHTTPRequest(p.Request)
+ req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI)
if err != nil {
p.Error(err)
return
}
- req.URL.Path = urlPathAPI
req.URL.RawQuery = url.Values{
urlQueryKeyAuth: []string{p.Password},
urlQueryKeySummaryRaw: []string{"true"},
@@ -153,13 +152,12 @@ func (p *Pihole) querySummary(pmx *piholeMetrics) {
}
func (p *Pihole) queryQueryTypes(pmx *piholeMetrics) {
- req, err := web.NewHTTPRequest(p.Request)
+ req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI)
if err != nil {
p.Error(err)
return
}
- req.URL.Path = urlPathAPI
req.URL.RawQuery = url.Values{
urlQueryKeyAuth: []string{p.Password},
urlQueryKeyGetQueryTypes: []string{"true"},
@@ -176,13 +174,12 @@ func (p *Pihole) queryQueryTypes(pmx *piholeMetrics) {
}
func (p *Pihole) queryForwardedDestinations(pmx *piholeMetrics) {
- req, err := web.NewHTTPRequest(p.Request)
+ req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI)
if err != nil {
p.Error(err)
return
}
- req.URL.Path = urlPathAPI
req.URL.RawQuery = url.Values{
urlQueryKeyAuth: []string{p.Password},
urlQueryKeyGetForwardDestinations: []string{"true"},
@@ -199,12 +196,11 @@ func (p *Pihole) queryForwardedDestinations(pmx *piholeMetrics) {
}
func (p *Pihole) queryAPIVersion() (int, error) {
- req, err := web.NewHTTPRequest(p.Request)
+ req, err := web.NewHTTPRequestWithPath(p.Request, urlPathAPI)
if err != nil {
return 0, err
}
- req.URL.Path = urlPathAPI
req.URL.RawQuery = url.Values{
urlQueryKeyAuth: []string{p.Password},
urlQueryKeyAPIVersion: []string{"true"},