From 429be85677b9a22fbc7673f93fbf9abf7e6774ce Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Fri, 14 Apr 2023 16:57:44 +0200 Subject: [PATCH 1/4] Drop XML v2 stats support, which is deprecated XML v2 stats was deprecated in BIND v9.10.0, which was itself EOL'd in July 2018. Closes: #170 Signed-off-by: Daniel Swarbrick --- bind/auto/auto.go | 6 +- bind/v2/v2.go | 135 -- bind_exporter.go | 5 +- bind_exporter_test.go | 66 +- fixtures/v2.xml | 4172 ----------------------------------------- 5 files changed, 13 insertions(+), 4371 deletions(-) delete mode 100644 bind/v2/v2.go delete mode 100644 fixtures/v2.xml diff --git a/bind/auto/auto.go b/bind/auto/auto.go index a6c10a1e..c4a20c56 100644 --- a/bind/auto/auto.go +++ b/bind/auto/auto.go @@ -17,7 +17,6 @@ import ( "net/http" "github.com/prometheus-community/bind_exporter/bind" - "github.com/prometheus-community/bind_exporter/bind/v2" "github.com/prometheus-community/bind_exporter/bind/v3" ) @@ -34,8 +33,5 @@ func NewClient(url string, c *http.Client) *Client { // Stats implements bind.Stats. func (c *Client) Stats(g ...bind.StatisticGroup) (bind.Statistics, error) { - if err := c.Get(v3.StatusPath, &bind.Statistics{}); err == nil { - return (&v3.Client{XMLClient: c.XMLClient}).Stats(g...) - } - return (&v2.Client{XMLClient: c.XMLClient}).Stats(g...) + return (&v3.Client{XMLClient: c.XMLClient}).Stats(g...) } diff --git a/bind/v2/v2.go b/bind/v2/v2.go deleted file mode 100644 index a7929dc6..00000000 --- a/bind/v2/v2.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2019 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v2 - -import ( - "encoding/xml" - "net/http" - "time" - - "github.com/prometheus-community/bind_exporter/bind" -) - -type Isc struct { - Bind Bind `xml:"bind"` - XMLName xml.Name `xml:"isc"` -} - -type Bind struct { - Statistics Statistics `xml:"statistics"` -} - -type Statistics struct { - Memory struct{} `xml:"memory"` - Server Server `xml:"server"` - Socketmgr struct{} `xml:"socketmgr"` - Taskmgr bind.TaskManager `xml:"taskmgr"` - Views []View `xml:"views>view"` -} - -type Server struct { - BootTime time.Time `xml:"boot-time"` - ConfigTime time.Time `xml:"config-time"` - NSStats []Counter `xml:"nsstat"` - QueriesIn []Counter `xml:"queries-in>rdtype"` - Requests []Counter `xml:"requests>opcode"` - SocketStats []Counter `xml:"socketstat"` - ZoneStats []Counter `xml:"zonestat"` -} - -type View struct { - Name string `xml:"name"` - Cache []bind.Gauge `xml:"cache>rrset"` - Rdtype []Counter `xml:"rdtype"` - Resstat []Counter `xml:"resstat"` - Zones []Zone `xml:"zones>zone"` -} - -type Zone struct { - Name string `xml:"name"` - Rdataclass string `xml:"rdataclass"` - Serial string `xml:"serial"` -} - -type Counter struct { - Name string `xml:"name"` - Counter uint64 `xml:"counter"` -} - -// Client implements bind.Client and can be used to query a BIND v2 API. -type Client struct { - *bind.XMLClient -} - -// NewClient returns an initialized Client. -func NewClient(url string, c *http.Client) *Client { - return &Client{XMLClient: bind.NewXMLClient(url, c)} -} - -// Stats implements bind.Stats. The BIND v2 API doesn't provide individual -// endpoints for different statistic groups, the passed parameters don't have -// any effect. -func (c *Client) Stats(...bind.StatisticGroup) (bind.Statistics, error) { - s := bind.Statistics{} - - root := Isc{} - if err := c.Get("/", &root); err != nil { - return s, err - } - stats := root.Bind.Statistics - - s.Server.BootTime = stats.Server.BootTime - for _, t := range stats.Server.QueriesIn { - s.Server.IncomingQueries = append(s.Server.IncomingQueries, bind.Counter(t)) - } - for _, t := range stats.Server.Requests { - s.Server.IncomingRequests = append(s.Server.IncomingRequests, bind.Counter(t)) - } - for _, t := range stats.Server.NSStats { - s.Server.NameServerStats = append(s.Server.NameServerStats, bind.Counter(t)) - } - for _, t := range stats.Server.ZoneStats { - s.Server.ZoneStatistics = append(s.Server.ZoneStatistics, bind.Counter(t)) - } - for _, view := range stats.Views { - v := bind.View{ - Name: view.Name, - Cache: view.Cache, - } - zv := bind.ZoneView{ - Name: view.Name, - } - for _, t := range view.Rdtype { - v.ResolverQueries = append(v.ResolverQueries, bind.Counter(t)) - } - for _, t := range view.Resstat { - v.ResolverStats = append(v.ResolverStats, bind.Counter(t)) - } - for _, zone := range view.Zones { - if zone.Rdataclass != "IN" { - continue - } - z := bind.ZoneCounter{ - Name: zone.Name, - Serial: zone.Serial, - } - zv.ZoneData = append(zv.ZoneData, z) - } - s.ZoneViews = append(s.ZoneViews, zv) - s.Views = append(s.Views, v) - } - s.TaskManager = stats.Taskmgr - - return s, nil -} diff --git a/bind_exporter.go b/bind_exporter.go index 9b3d300e..ab0c77ee 100644 --- a/bind_exporter.go +++ b/bind_exporter.go @@ -30,7 +30,6 @@ import ( "github.com/prometheus-community/bind_exporter/bind" "github.com/prometheus-community/bind_exporter/bind/auto" "github.com/prometheus-community/bind_exporter/bind/json" - "github.com/prometheus-community/bind_exporter/bind/v2" "github.com/prometheus-community/bind_exporter/bind/v3" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" @@ -404,8 +403,6 @@ func NewExporter(logger log.Logger, version, url string, timeout time.Duration, switch version { case "json": c = json.NewClient(url, &http.Client{Timeout: timeout}) - case "xml.v2": - c = v2.NewClient(url, &http.Client{Timeout: timeout}) case "xml.v3": c = v3.NewClient(url, &http.Client{Timeout: timeout}) default: @@ -539,7 +536,7 @@ func main() { ).Default("/run/named/named.pid").String() bindVersion = kingpin.Flag("bind.stats-version", "BIND statistics version. Can be detected automatically.", - ).Default("auto").Enum("json", "xml.v2", "xml.v3", "auto") + ).Default("auto").Enum("json", "xml.v3", "auto") metricsPath = kingpin.Flag( "web.telemetry-path", "Path under which to expose metrics", ).Default("/metrics").String() diff --git a/bind_exporter_test.go b/bind_exporter_test.go index 058a2c39..7d566ae8 100644 --- a/bind_exporter_test.go +++ b/bind_exporter_test.go @@ -27,7 +27,7 @@ import ( ) var ( - serverStatsV2 = []string{ + serverStats = []string{ `bind_boot_time_seconds 1.626325868e+09`, `bind_incoming_queries_total{type="A"} 128417`, `bind_incoming_requests_total{opcode="QUERY"} 37634`, @@ -40,13 +40,11 @@ var ( `bind_zone_transfer_success_total 25`, `bind_zone_transfer_failure_total 1`, `bind_recursive_clients 76`, - } - serverStatsV3 = combine(serverStatsV2, []string{ `bind_config_time_seconds 1.626325868e+09`, `bind_response_rcodes_total{rcode="NOERROR"} 989812`, `bind_response_rcodes_total{rcode="NXDOMAIN"} 33958`, - }) - viewStatsV2 = []string{ + } + viewStats = []string{ `bind_resolver_cache_rrsets{type="A",view="_default"} 34324`, `bind_resolver_queries_total{type="CNAME",view="_default"} 28`, `bind_resolver_response_errors_total{error="FORMERR",view="_bind"} 0`, @@ -65,11 +63,9 @@ var ( `bind_resolver_query_duration_seconds_bucket{view="_default",le="1.6"} 188409`, `bind_resolver_query_duration_seconds_bucket{view="_default",le="+Inf"} 227755`, `bind_zone_serial{view="_default",zone_name="TEST_ZONE"} 123`, - } - viewStatsV3 = combine(viewStatsV2, []string{ `bind_resolver_response_errors_total{error="REFUSED",view="_bind"} 17`, `bind_resolver_response_errors_total{error="REFUSED",view="_default"} 5798`, - }) + } taskStats = []string{ `bind_tasks_running 8`, `bind_worker_threads 16`, @@ -81,17 +77,7 @@ func TestBindExporterJSONClient(t *testing.T) { server: newJSONServer(), groups: []bind.StatisticGroup{bind.ServerStats, bind.ViewStats, bind.TaskStats}, version: "json", - include: combine([]string{`bind_up 1`}, serverStatsV3, viewStatsV3, taskStats), - }.run(t) -} - -func TestBindExporterV2Client(t *testing.T) { - bindExporterTest{ - server: newV2Server(), - groups: []bind.StatisticGroup{bind.ServerStats, bind.ViewStats, bind.TaskStats}, - version: "xml.v2", - include: combine([]string{`bind_up 1`}, serverStatsV2, viewStatsV2, taskStats), - exclude: []string{`bind_config_time_seconds`}, + include: combine([]string{`bind_up 1`}, serverStats, viewStats, taskStats), }.run(t) } @@ -100,45 +86,25 @@ func TestBindExporterV3Client(t *testing.T) { server: newV3Server(), groups: []bind.StatisticGroup{bind.ServerStats, bind.ViewStats, bind.TaskStats}, version: "xml.v3", - include: combine([]string{`bind_up 1`}, serverStatsV3, viewStatsV3, taskStats), + include: combine([]string{`bind_up 1`}, serverStats, viewStats, taskStats), }.run(t) } func TestBindExporterAutomaticClient(t *testing.T) { - for _, test := range []bindExporterTest{ - { - server: newV2Server(), - groups: []bind.StatisticGroup{bind.ServerStats}, - version: "auto", - include: combine([]string{`bind_up 1`}, serverStatsV2), - }, - { - server: newV3Server(), - groups: []bind.StatisticGroup{bind.ServerStats}, - version: "auto", - include: combine([]string{`bind_up 1`}, serverStatsV3), - }, - } { - test.run(t) - } -} - -func TestBindExporterStatisticGroups(t *testing.T) { bindExporterTest{ - server: newV2Server(), + server: newV3Server(), groups: []bind.StatisticGroup{bind.ServerStats}, - version: "xml.v2", - include: combine([]string{`bind_up 1`}, serverStatsV2), - exclude: combine(viewStatsV2, taskStats, []string{`bind_tasks_running 0`, `bind_worker_threads 0`}), + version: "auto", + include: combine([]string{`bind_up 1`}, serverStats), }.run(t) } func TestBindExporterBindFailure(t *testing.T) { bindExporterTest{ server: httptest.NewServer(http.HandlerFunc(http.NotFound)), - version: "xml.v2", + version: "xml.v3", include: []string{`bind_up 0`}, - exclude: serverStatsV2, + exclude: serverStats, }.run(t) } @@ -197,16 +163,6 @@ func collect(c prometheus.Collector) ([]byte, error) { return b.Bytes(), nil } -func newV2Server() *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.RequestURI == "/" { - http.ServeFile(w, r, "fixtures/v2.xml") - } else { - http.NotFound(w, r) - } - })) -} - func newV3Server() *httptest.Server { m := map[string]string{ "/xml/v3/server": "fixtures/v3/server", diff --git a/fixtures/v2.xml b/fixtures/v2.xml deleted file mode 100644 index 5736b1a4..00000000 --- a/fixtures/v2.xml +++ /dev/null @@ -1,4172 +0,0 @@ - - - - - - - - _default - - - TEST_ZONE - IN - 123 - - - 0.in-addr.arpa/IN - IN - 1 - - - 127.in-addr.arpa/IN - IN - 1 - - - 255.in-addr.arpa/IN - IN - 1 - - - 255.255.255.255.IN-ADDR.ARPA/IN - IN - 0 - - - 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA/IN - IN - 0 - - - 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA/IN - IN - 0 - - - localhost/IN - IN - 2 - - - - A - 1011915389 - - - NS - 1574857 - - - CNAME - 28 - - - SOA - 59242 - - - PTR - 81385673 - - - MX - 64935479 - - - TXT - 655612 - - - AAAA - 1632196121 - - - SRV - 1892876223 - - - DS - 129 - - - DNSKEY - 63 - - - ANY - 398 - - - Queryv4 - 4670887418 - - - Queryv6 - 14711796 - - - Responsev4 - 4652412007 - - - Responsev6 - 10138 - - - NXDOMAIN - 16707 - - - SERVFAIL - 7596 - - - FORMERR - 42906 - - - OtherError - 20660 - - - EDNS0Fail - 2896663 - - - Mismatch - 0 - - - Truncated - 108207185 - - - Lame - 9108 - - - Retry - 170636698 - - - QueryAbort - 0 - - - QuerySockFail - 0 - - - QueryTimeout - 19207431 - - - GlueFetchv4 - 10754416 - - - GlueFetchv6 - 12171523 - - - GlueFetchv4Fail - 367654 - - - GlueFetchv6Fail - 9673643 - - - ValAttempt - 0 - - - ValOk - 0 - - - ValNegOk - 0 - - - ValFail - 0 - - - QryRTT10 - 38334 - - - QryRTT100 - 74788 - - - QryRTT500 - 69536 - - - QryRTT800 - 4717 - - - QryRTT1600 - 1034 - - - QryRTT1600+ - 39346 - - - - A - 34324 - - - NS - 37068 - - - CNAME - 2037 - - - PTR - 2550 - - - MX - 3582 - - - TXT - 144 - - - AAAA - 4665 - - - SRV - 815 - - - DS - 778 - - - RRSIG - 3841 - - - NSEC - 1158 - - - !A - 29 - - - !MX - 416 - - - !TXT - 16 - - - !AAAA - 6948 - - - !SRV - 20 - - - NXDOMAIN - 6412 - - - - - _bind - - - authors.bind/CH - CH - 0 - - - hostname.bind/CH - CH - 0 - - - version.bind/CH - CH - 0 - - - id.server/CH - CH - 0 - - - - Queryv4 - 0 - - - Queryv6 - 0 - - - Responsev4 - 0 - - - Responsev6 - 0 - - - NXDOMAIN - 0 - - - SERVFAIL - 0 - - - FORMERR - 0 - - - OtherError - 0 - - - EDNS0Fail - 0 - - - Mismatch - 0 - - - Truncated - 0 - - - Lame - 0 - - - Retry - 0 - - - QueryAbort - 0 - - - QuerySockFail - 0 - - - QueryTimeout - 0 - - - GlueFetchv4 - 0 - - - GlueFetchv6 - 0 - - - GlueFetchv4Fail - 0 - - - GlueFetchv6Fail - 0 - - - ValAttempt - 0 - - - ValOk - 0 - - - ValNegOk - 0 - - - ValFail - 0 - - - QryRTT10 - 0 - - - QryRTT100 - 0 - - - QryRTT500 - 0 - - - QryRTT800 - 0 - - - QryRTT1600 - 0 - - - QryRTT1600+ - 0 - - - - - - - - 0x7f989b7f4010 - statchannel - 1 - tcp - 127.0.0.1#3080 - - listener - bound - - - - 0x7f989b7f4490 - dispatcher - 41 - udp - 1.2.3.4#53 - - bound - - - - 0x7f989b7f46d0 - dispatcher - 18 - tcp - 1.2.3.5#53 - - listener - bound - - - - 0x7f989b7f4910 - control - 1 - tcp - 127.0.0.1#953 - - listener - bound - - - - 0x7f989b7f4d90 - control - 1 - tcp - ::1#953 - - listener - bound - - - - 0x7f988025c690 - 1 - udp - - - - 0x7f9881ff8b60 - 1 - udp - - - - 0x7f9878a0d050 - 1 - udp - - - - 0x7f9889043ae0 - 1 - udp - - - - 0x7f98751fdaf0 - 1 - udp - - - - 0x7f9875230d30 - 1 - udp - - - - 0x7f987de93200 - 1 - udp - - - - 0x7f98789fcdd0 - 1 - udp - - - - 0x7f9880279b10 - 1 - udp - - - - 0x7f98867f5490 - 1 - udp - - - - 0x7f988d54ab50 - 1 - udp - - - - 0x7f9880279d50 - 1 - udp - - - - 0x7f988025cd50 - 1 - udp - - - - 0x7f98808c3e80 - 1 - udp - - - - 0x7f987de7ed80 - 1 - udp - - - - 0x7f9881fbb460 - 1 - udp - - - - 0x7f9874437310 - 1 - udp - - - - 0x7f9881fd96a0 - 1 - udp - - - - 0x7f988c178010 - 1 - udp - - - - 0x7f987de7a900 - 1 - udp - - - - 0x7f98867f5910 - 1 - udp - - - - 0x7f988d542910 - 1 - udp - - - - 0x7f989b77cb50 - 1 - udp - - - - 0x7f9881fdffe0 - 1 - udp - - - - 0x7f9875231870 - 1 - udp - - - - 0x7f9881fe6460 - 1 - udp - - - - 0x7f98867fe250 - 1 - udp - - - - 0x7f98808bfa00 - 1 - udp - - - - 0x7f9878a0d4d0 - 1 - udp - - - - 0x7f98785ff750 - 1 - udp - - - - 0x7f9874437e50 - 1 - udp - - - - 0x7f9889049860 - 1 - udp - - - - 0x7f9880268450 - 1 - udp - - - - 0x7f988c179910 - 1 - udp - - - - 0x7f988d56b910 - 1 - udp - - - - 0x7f988c179010 - 1 - udp - - - - 0x7f9875226af0 - 1 - udp - - - - 0x7f98867fe6d0 - 1 - udp - - - - 0x7f988025c8d0 - 1 - udp - - - - 0x7f9889047620 - 1 - udp - - - - 0x7f98789fc710 - 1 - udp - - - - 0x7f9874421550 - 1 - udp - - - - 0x7f9881fc7fe0 - 1 - udp - - - - 0x7f987de7e900 - 1 - udp - - - - 0x7f98808c7300 - 1 - udp - - - - 0x7f9881ff9460 - 1 - udp - - - - 0x7f98752313f0 - 1 - udp - - - - 0x7f9878a08290 - 1 - udp - - - - 0x7f9881fc1fe0 - 1 - udp - - - - 0x7f98867fe910 - 1 - udp - - - - 0x7f98808bfe80 - 1 - udp - - - - 0x7f9881fc2b60 - 1 - udp - - - - 0x7f9880268f90 - 1 - udp - - - - 0x7f98867fb910 - 1 - udp - - - - 0x7f98752273f0 - 1 - udp - - - - 0x7f98867feb50 - 1 - udp - - - - 0x7f98752321b0 - 1 - udp - - - - 0x7f988903e3e0 - 1 - udp - - - - 0x7f98751ffaf0 - 1 - udp - - - - 0x7f987de89fc0 - 1 - udp - - - - 0x7f98789fb710 - 1 - udp - - - - 0x7f9881fc26a0 - 1 - udp - - - - 0x7f98808c40c0 - 1 - udp - - - - 0x7f9881fd3460 - 1 - udp - - - - 0x7f9881fedda0 - 1 - udp - - - - 0x7f98867fcb50 - 1 - udp - - - - 0x7f987523c630 - 1 - udp - - - - 0x7f9880267b10 - 1 - udp - - - - 0x7f9878600990 - 1 - udp - - - - 0x7f987c4c5f40 - 1 - udp - - - - 0x7f988903dd20 - 1 - udp - - - - 0x7f9875230630 - 1 - udp - - - - 0x7f9889048860 - 1 - udp - - - - 0x7f987de7a480 - 1 - udp - - - - 0x7f988d542250 - 1 - udp - - - - 0x7f9881fd38e0 - 1 - udp - - - - 0x7f9889049620 - 1 - udp - - - - 0x7f987522df70 - 1 - udp - - - - 0x7f98789fa290 - 1 - udp - - - - 0x7f9881fd8b60 - 1 - udp - - - - 0x7f9881fdcfe0 - 1 - udp - - - - 0x7f9878a0f290 - 1 - udp - - - - 0x7f9881ff48e0 - 1 - udp - - - - 0x7f987de87480 - 1 - udp - - - - 0x7f9881fd0b60 - 1 - udp - - - - 0x7f9881fdfda0 - 1 - udp - - - - 0x7f9881fc36a0 - 1 - udp - - - - 0x7f987de8fb40 - 1 - udp - - - - 0x7f988903fae0 - 1 - udp - - - - 0x7f988025d1d0 - 1 - udp - - - - 0x7f9875232870 - 1 - udp - - - - 0x7f9889046d20 - 1 - udp - - - - 0x7f987de97480 - 1 - udp - - - - 0x7f988d5486d0 - 1 - udp - - - - 0x7f9889057f60 - 1 - udp - - - - 0x7f98808c37c0 - 1 - udp - - - - 0x7f98808c2580 - 1 - udp - - - - 0x7f9881fdd460 - 1 - udp - - - - 0x7f987de7ab40 - 1 - udp - - - - 0x7f988d53f910 - 1 - udp - - - - 0x7f98752003f0 - 1 - udp - - - - 0x7f98808c17c0 - 1 - udp - - - - 0x7f988d53f490 - 1 - udp - - - - 0x7f9889057ae0 - 1 - udp - - - - 0x7f9889046620 - 1 - udp - - - - 0x7f987de96b40 - 1 - udp - - - - 0x7f988d542b50 - 1 - udp - - - - 0x7f9880268b10 - 1 - udp - - - - 0x7f9881fefb60 - 1 - udp - - - - 0x7f9881fbe8e0 - 1 - udp - - - - 0x7f987de85900 - 1 - udp - - - - 0x7f9878603050 - 1 - udp - 198.133.159.1#53 - 1.2.3.6#33735 - - connected - bound - - - - 0x7f98808c80c0 - 1 - udp - - - - 0x7f98789fb4d0 - 1 - udp - - - - 0x7f9875231f70 - 1 - udp - - - - 0x7f988d54a010 - 1 - udp - - - - 0x7f9881fd8fe0 - 1 - udp - - - - 0x7f989b770250 - 1 - udp - - - - 0x7f9881ff38e0 - 1 - udp - - - - 0x7f988c1ab910 - 1 - udp - - - - 0x7f9881feada0 - 1 - udp - - - - 0x7f9881fdfb60 - 1 - udp - - - - 0x7f98751ffd30 - 1 - udp - - - - 0x7f98752331b0 - 1 - udp - - - - 0x7f9881fe1b60 - 1 - udp - - - - 0x7f988903df60 - 1 - udp - - - - 0x7f98867f6910 - 1 - udp - - - - 0x7f9878601bd0 - 1 - udp - - - - 0x7f9881ff9220 - 1 - udp - - - - 0x7f9878a084d0 - 1 - udp - - - - 0x7f98789fa710 - 1 - udp - - - - 0x7f98808c8300 - 1 - udp - - - - 0x7f987523bf70 - 1 - udp - - - - 0x7f98808c5580 - 1 - udp - - - - 0x7f987522e630 - 1 - udp - - - - 0x7f987de78480 - 1 - udp - - - - 0x7f9881fe2460 - 1 - udp - - - - 0x7f9881fcab60 - 1 - udp - - - - 0x7f98752001b0 - 1 - udp - - - - 0x7f9881fe66a0 - 1 - udp - - - - 0x7f9881fd9460 - 1 - udp - - - - 0x7f9881feffe0 - 1 - udp - - - - 0x7f988c1ab010 - 1 - udp - - - - 0x7f9881fbe6a0 - 1 - udp - - - - 0x7f98752301b0 - 1 - udp - - - - 0x7f9881fbada0 - 1 - udp - - - - 0x7f987de85fc0 - 1 - udp - - - - 0x7f9889047d20 - 1 - udp - - - - 0x7f987c4c5d00 - 1 - udp - - - - 0x7f9881fbdb60 - 1 - udp - - - - 0x7f98890453e0 - 1 - udp - - - - 0x7f9878600750 - 1 - udp - - - - 0x7f98789f94d0 - 1 - udp - - - - 0x7f989b783010 - 1 - udp - - - - 0x7f987de7eb40 - 1 - udp - - - - 0x7f9889049f60 - 1 - udp - - - - 0x7f9881fdd6a0 - 1 - udp - - - - 0x7f9874421790 - 1 - udp - - - - 0x7f9881ff0220 - 1 - udp - - - - 0x7f9889048d20 - 1 - udp - - - - 0x7f98808c30c0 - 1 - udp - - - - 0x7f988d56b490 - 1 - udp - - - - 0x7f988903d860 - 1 - udp - - - - 0x7f9875200af0 - 1 - udp - - - - 0x7f9881fe3fe0 - 1 - udp - - - - 0x7f9889044860 - 1 - udp - - - - 0x7f988903e620 - 1 - udp - - - - 0x7f988026a8d0 - 1 - udp - - - - 0x7f988c178b50 - 1 - udp - - - - 0x7f9878601990 - 1 - udp - - - - 0x7f9881fd18e0 - 1 - udp - - - - 0x7f987de7f200 - 1 - udp - - - - 0x7f9881fd16a0 - 1 - udp - - - - 0x7f98752013f0 - 1 - udp - - - - 0x7f9878603750 - 1 - udp - - - - 0x7f9881fe06a0 - 1 - udp - - - - 0x7f98890483e0 - 1 - udp - - - - 0x7f98751ff630 - 1 - udp - - - - 0x7f9881fdcda0 - httpd - 1 - tcp - 127.0.0.1#43522 - 127.0.0.1#3080 - - connected - bound - - - - 0x7f98808c6c40 - client-tcp - 0 - tcp - - - - 0x7f9881ff46a0 - httpd - 1 - tcp - 127.0.0.1#43523 - 127.0.0.1#3080 - - connected - bound - - - - - - - threaded - 16 - 5 - 8 - - - - server - 9 - 0x7f989b7cd010 - idle - 5 - - - zmgr - 2 - 0x7f989b7cd0c0 - idle - -1 - - - - - 2021-07-15T05:11:08.926Z - 2021-07-15T10:25:39.396Z - - - QUERY - 37634 - - - - - A - 128417 - - - NS - 3476120 - - - CNAME - 14 - - - SOA - 17403 - - - PTR - 668101860 - - - MX - 83041113 - - - TXT - 831371 - - - AAAA - 6422434582 - - - SRV - 17615222972 - - - DS - 479 - - - DNSKEY - 195 - - - ANY - 286 - - - - Requestv4 - 37634916000 - - - Requestv6 - 0 - - - ReqEdns0 - 37433570733 - - - ReqBadEDNSVer - 0 - - - ReqTSIG - 0 - - - ReqSIG0 - 0 - - - ReqBadSIG - 0 - - - ReqTCP - 3987609581 - - - AuthQryRej - 0 - - - RecQryRej - 2950 - - - XfrRej - 3 - - - UpdateRej - 0 - - - Response - 37610934798 - - - TruncatedResp - 4338900351 - - - RespEDNS0 - 37409805742 - - - RespTSIG - 0 - - - RespSIG0 - 0 - - - QrySuccess - 29313 - - - QryAuthAns - 1330 - - - QryNoauthAns - 37281392622 - - - QryReferral - 0 - - - QryNxrrset - 6050349352 - - - QrySERVFAIL - 329537896 - - - QryFORMERR - 0 - - - QryNXDOMAIN - 1917292662 - - - QryRecursion - 60946 - - - QryDuplicate - 216 - - - QryDropped - 237 - - - QryFailure - 2950 - - - XfrReqDone - 0 - - - UpdateReqFwd - 0 - - - UpdateRespFwd - 0 - - - UpdateFwdFail - 0 - - - UpdateDone - 0 - - - UpdateFail - 0 - - - UpdateBadPrereq - 0 - - - RecursClients - 76 - - - RPZRewrites - 0 - - - RateDropped - 0 - - - RateSlipped - 0 - - - NotifyOutv4 - 0 - - - NotifyOutv6 - 0 - - - NotifyInv4 - 0 - - - NotifyInv6 - 0 - - - NotifyRej - 0 - - - SOAOutv4 - 0 - - - SOAOutv6 - 0 - - - AXFRReqv4 - 0 - - - AXFRReqv6 - 0 - - - IXFRReqv4 - 0 - - - IXFRReqv6 - 0 - - - XfrSuccess - 25 - - - XfrFail - 1 - - - Mismatch - 935 - - - UDP4Open - 4563810923 - - - UDP6Open - 14712407 - - - TCP4Open - 108207194 - - - TCP6Open - 1 - - - UnixOpen - 0 - - - UDP4OpenFail - 0 - - - UDP6OpenFail - 0 - - - TCP4OpenFail - 0 - - - TCP6OpenFail - 0 - - - UnixOpenFail - 0 - - - UDP4Close - 4563810919 - - - UDP6Close - 14712407 - - - TCP4Close - 4096301824 - - - TCP6Close - 0 - - - UnixClose - 0 - - - FDWatchClose - 0 - - - UDP4BindFail - 1129591 - - - UDP6BindFail - 554 - - - TCP4BindFail - 0 - - - TCP6BindFail - 0 - - - UnixBindFail - 0 - - - FdwatchBindFail - 0 - - - UDP4ConnFail - 1102 - - - UDP6ConnFail - 14701715 - - - TCP4ConnFail - 126 - - - TCP6ConnFail - 0 - - - UnixConnFail - 0 - - - FDwatchConnFail - 0 - - - UDP4Conn - 4562680229 - - - UDP6Conn - 10138 - - - TCP4Conn - 108092667 - - - TCP6Conn - 0 - - - UnixConn - 0 - - - FDwatchConn - 0 - - - TCP4AcceptFail - 0 - - - TCP6AcceptFail - 0 - - - UnixAcceptFail - 0 - - - TCP4Accept - 3988094638 - - - TCP6Accept - 0 - - - UnixAccept - 0 - - - UDP4SendErr - 0 - - - UDP6SendErr - 14701658 - - - TCP4SendErr - 11 - - - TCP6SendErr - 0 - - - UnixSendErr - 0 - - - FDwatchSendErr - 0 - - - UDP4RecvErr - 2745 - - - UDP6RecvErr - 0 - - - TCP4RecvErr - 18357 - - - TCP6RecvErr - 0 - - - UnixRecvErr - 0 - - - FDwatchRecvErr - 0 - - - - - - 0x7f989bd061d0 - main - 254 - 8782624 - 3631720 - 9076744 - 7864320 - 9 - 0 - 0 - - - 0x7f989bd158d0 - dst - 1 - 133168 - 96136 - 101227 - - - 0 - 0 - 0 - - - 0x7f989bd2dc10 - threadkey - 1 - 0 - 0 - 0 - - - 0 - 0 - 0 - - - 0x7f989bd3ce20 - client - 51 - 1850064 - 571200 - 1352368 - 1572864 - 100 - 0 - 0 - - - 0x7f989bd3cf90 - client - 51 - 1850064 - 571200 - 1353248 - 1572864 - 100 - 0 - 0 - - - 0x7f989bda24a0 - client - 51 - 1587920 - 571200 - 1290632 - 1310720 - 100 - 0 - 0 - - - 0x7f989bda2610 - client - 51 - 1850064 - 576840 - 1392800 - 1572864 - 100 - 0 - 0 - - - 0x7f989bda1470 - client - 51 - 1850064 - 571200 - 1353664 - 1572864 - 100 - 0 - 0 - - - 0x7f989bd5be70 - client - 51 - 1850064 - 571200 - 1319184 - 1572864 - 100 - 0 - 0 - - - 0x7f989bd5bfe0 - client - 51 - 1850064 - 571200 - 1373056 - 1572864 - 100 - 0 - 0 - - - 0x7f989bd5c150 - client - 51 - 1587920 - 571200 - 1312113 - 1310720 - 100 - 0 - 0 - - - 0x7f989bd9e3b0 - client - 51 - 1587920 - 571200 - 1284872 - 1310720 - 100 - 0 - 0 - - - 0x7f989bd9e520 - client - 51 - 1587920 - 571200 - 1210944 - 1310720 - 100 - 0 - 0 - - - 0x7f989bd9e690 - client - 51 - 1587920 - 571200 - 1210968 - 1310720 - 100 - 0 - 0 - - - 0x7f989be85c60 - client - 51 - 1587920 - 571200 - 1236505 - 1310720 - 100 - 0 - 0 - - - 0x7f989be93fc0 - client - 51 - 1587920 - 571200 - 1210648 - 1310720 - 100 - 0 - 0 - - - 0x7f989bea2320 - client - 51 - 1587920 - 571200 - 1276576 - 1310720 - 100 - 0 - 0 - - - 0x7f989beb0680 - client - 51 - 1587920 - 573264 - 1204688 - 1310720 - 100 - 0 - 0 - - - 0x7f989bebe9e0 - client - 51 - 1587920 - 571200 - 1207768 - 1310720 - 100 - 0 - 0 - - - 0x7f989beccd40 - client - 51 - 1587920 - 585232 - 1241849 - 1310720 - 100 - 0 - 0 - - - 0x7f989bd3cbe0 - cache - 4 - 67020323 - 29008987 - 58299467 - 65798144 - 0 - 0 - 0 - - - 0x7f989bda1b80 - cache_heap - 18 - 1671168 - 1410048 - 1491968 - 262144 - 0 - 0 - 0 - - - 0x7f989c09e940 - cache - 4 - 279120 - 20904 - 20904 - 262144 - 0 - 0 - 0 - - - 0x7f989c0a96d0 - cache_heap - 18 - 262144 - 1024 - 1024 - 262144 - 0 - 0 - 0 - - - 0x7f989bd5f270 - client - 51 - 1587920 - 571200 - 1218880 - 1310720 - 100 - 0 - 0 - - - 0x7f989bd5f3e0 - client - 51 - 1850064 - 571200 - 1369184 - 1572864 - 100 - 0 - 0 - - - 0x7f9888005eb0 - client - 51 - 1587920 - 571200 - 1209992 - 1310720 - 100 - 0 - 0 - - - 0x7f989bd5f550 - client - 51 - 1587920 - 571200 - 1210664 - 1310720 - 100 - 0 - 0 - - - 0x7f9888017230 - client - 51 - 1850064 - 571200 - 1369272 - 1572864 - 100 - 0 - 0 - - - 0x7f989bda0370 - client - 51 - 1587920 - 571200 - 1266545 - 1310720 - 100 - 0 - 0 - - - 0x7f989bda0740 - client - 51 - 1850064 - 571200 - 1405696 - 1572864 - 100 - 0 - 0 - - - 0x7f989bda04e0 - client - 51 - 1587920 - 571200 - 1209776 - 1310720 - 100 - 0 - 0 - - - 0x7f989c2c6b70 - client - 51 - 1587920 - 571200 - 1213464 - 1310720 - 100 - 0 - 0 - - - 0x7f989c2c6ce0 - client - 51 - 1587920 - 571200 - 1232601 - 1310720 - 100 - 0 - 0 - - - 0x7f9888025b40 - client - 51 - 1587920 - 571200 - 1265320 - 1310720 - 100 - 0 - 0 - - - 0x7f989c2c6e50 - client - 51 - 1587920 - 576728 - 1212592 - 1310720 - 100 - 0 - 0 - - - 0x7f989c2bfaf0 - client - 51 - 1587920 - 571200 - 1211472 - 1310720 - 100 - 0 - 0 - - - 0x7f989c2bfc60 - client - 51 - 1587920 - 571200 - 1214368 - 1310720 - 100 - 0 - 0 - - - 0x7f989c2bfdd0 - client - 51 - 1587920 - 571200 - 1204112 - 1310720 - 100 - 0 - 0 - - - 0x7f989c31ec50 - client - 51 - 1587920 - 571200 - 1208272 - 1310720 - 100 - 0 - 0 - - - 0x7f989c31edc0 - client - 51 - 1587920 - 571200 - 1235145 - 1310720 - 100 - 0 - 0 - - - 0x7f9888026260 - client - 51 - 1587920 - 571200 - 1220001 - 1310720 - 100 - 0 - 0 - - - 0x7f989c266aa0 - client - 51 - 1850064 - 571200 - 1382440 - 1572864 - 100 - 0 - 0 - - - 0x7f98880263d0 - client - 50 - 1582376 - 559776 - 1208785 - 1310720 - 98 - 0 - 0 - - - 0x7f989c266c10 - client - 50 - 1844520 - 559776 - 1354728 - 1572864 - 98 - 0 - 0 - - - 0x7f989c27e750 - client - 50 - 1844520 - 559776 - 1326464 - 1572864 - 98 - 0 - 0 - - - 0x7f988804c8a0 - client - 50 - 1582376 - 559776 - 1262000 - 1310720 - 98 - 0 - 0 - - - 0x7f989c27e8c0 - client - 50 - 1844520 - 559776 - 1434433 - 1572864 - 98 - 0 - 0 - - - 0x7f989c27ea30 - client - 50 - 1582376 - 559776 - 1197848 - 1310720 - 98 - 0 - 0 - - - 0x7f9888038b50 - client - 50 - 1582376 - 559776 - 1261856 - 1310720 - 98 - 0 - 0 - - - 0x7f989c34b7b0 - client - 50 - 1582376 - 559776 - 1200936 - 1310720 - 98 - 0 - 0 - - - 0x7f9888038cc0 - client - 50 - 1582376 - 559776 - 1229041 - 1310720 - 98 - 0 - 0 - - - 0x7f989c34b920 - client - 50 - 1582376 - 559776 - 1193592 - 1310720 - 98 - 0 - 0 - - - 0x7f98880332d0 - client - 50 - 1582376 - 559776 - 1203272 - 1310720 - 98 - 0 - 0 - - - 0x7f9888033440 - client - 50 - 1844520 - 559776 - 1355432 - 1572864 - 98 - 0 - 0 - - - 0x7f989c34ba90 - client - 50 - 1582376 - 559776 - 1188504 - 1310720 - 98 - 0 - 0 - - - 0x7f989c3a8dc0 - client - 50 - 1582376 - 559776 - 1196288 - 1310720 - 98 - 0 - 0 - - - 0x7f989c3a8f30 - client - 50 - 1844520 - 559776 - 1365048 - 1572864 - 98 - 0 - 0 - - - 0x7f989c341df0 - client - 50 - 1582376 - 559776 - 1208936 - 1310720 - 98 - 0 - 0 - - - 0x7f9888016dc0 - client - 50 - 1582376 - 569872 - 1256392 - 1310720 - 98 - 0 - 0 - - - 0x7f989c341f60 - client - 50 - 1582376 - 559776 - 1210913 - 1310720 - 98 - 0 - 0 - - - 0x7f9888016f30 - client - 50 - 1844520 - 559776 - 1341640 - 1572864 - 98 - 0 - 0 - - - 0x7f98880170a0 - client - 50 - 1582376 - 559776 - 1197416 - 1310720 - 98 - 0 - 0 - - - 0x7f989c3420d0 - client - 50 - 1582376 - 559776 - 1195192 - 1310720 - 98 - 0 - 0 - - - 0x7f9888056470 - client - 50 - 1582376 - 559776 - 1210177 - 1310720 - 98 - 0 - 0 - - - 0x7f989c2b7a80 - client - 50 - 1844520 - 559776 - 1364912 - 1572864 - 98 - 0 - 0 - - - 0x7f98880565e0 - client - 50 - 1582376 - 559776 - 1251017 - 1310720 - 98 - 0 - 0 - - - 0x7f989c4978a0 - client - 50 - 1844520 - 559776 - 1362064 - 1572864 - 98 - 0 - 0 - - - 0x7f989c4c10f0 - client - 50 - 1582376 - 559776 - 1281720 - 1310720 - 98 - 0 - 0 - - - 0x7f989c4c1260 - client - 50 - 1582376 - 559776 - 1228273 - 1310720 - 98 - 0 - 0 - - - 0x7f989c2b7bf0 - client - 50 - 1582376 - 559776 - 1201000 - 1310720 - 98 - 0 - 0 - - - 0x7f989c2b7d60 - client - 50 - 1582376 - 559776 - 1255881 - 1310720 - 98 - 0 - 0 - - - 0x7f989c4a1380 - client - 50 - 1844520 - 559776 - 1324952 - 1572864 - 98 - 0 - 0 - - - 0x7f98880f53c0 - client - 50 - 1582376 - 574344 - 1197944 - 1310720 - 98 - 0 - 0 - - - 0x7f989c3a84d0 - client - 50 - 1844520 - 559776 - 1326352 - 1572864 - 98 - 0 - 0 - - - 0x7f98880e7720 - client - 50 - 1582376 - 559776 - 1197880 - 1310720 - 98 - 0 - 0 - - - 0x7f98880389e0 - client - 50 - 1582376 - 588672 - 1359928 - 1310720 - 98 - 0 - 0 - - - 0x7f989c3a8640 - client - 50 - 1582376 - 559776 - 1254568 - 1310720 - 98 - 0 - 0 - - - 0x7f98880d8a60 - client - 50 - 1582376 - 559776 - 1201793 - 1310720 - 98 - 0 - 0 - - - 0x7f989c28f940 - client - 50 - 1582376 - 559776 - 1199888 - 1310720 - 98 - 0 - 0 - - - 0x7f98880d8bd0 - client - 50 - 1582376 - 559776 - 1201680 - 1310720 - 98 - 0 - 0 - - - 0x7f989c28fab0 - client - 50 - 1844520 - 559776 - 1357992 - 1572864 - 98 - 0 - 0 - - - 0x7f9888055540 - client - 50 - 1844520 - 559776 - 1332584 - 1572864 - 98 - 0 - 0 - - - 0x7f989c28fc20 - client - 50 - 1844520 - 559776 - 1339872 - 1572864 - 98 - 0 - 0 - - - 0x7f989c5221e0 - client - 50 - 1582376 - 559776 - 1206064 - 1310720 - 98 - 0 - 0 - - - 0x7f989c522350 - client - 50 - 1844520 - 559776 - 1294216 - 1572864 - 98 - 0 - 0 - - - 0x7f98880f8380 - client - 50 - 1582376 - 559776 - 1200176 - 1310720 - 98 - 0 - 0 - - - 0x7f989c5224c0 - client - 50 - 1582376 - 559776 - 1198840 - 1310720 - 98 - 0 - 0 - - - 0x7f9888071c10 - client - 50 - 1582376 - 559776 - 1207064 - 1310720 - 98 - 0 - 0 - - - 0x7f9888071d80 - client - 50 - 1582376 - 585216 - 1210905 - 1310720 - 98 - 0 - 0 - - - 0x7f988803aa40 - client - 50 - 1582376 - 559776 - 1230288 - 1310720 - 98 - 0 - 0 - - - 0x7f989c57d460 - client - 50 - 1582376 - 559776 - 1266146 - 1310720 - 98 - 0 - 0 - - - 0x7f989c54e920 - client - 50 - 1844520 - 559776 - 1323792 - 1572864 - 98 - 0 - 0 - - - 0x7f989c54ea90 - client - 50 - 1582376 - 559776 - 1219377 - 1310720 - 98 - 0 - 0 - - - 0x7f989c521500 - client - 50 - 1582376 - 559776 - 1285344 - 1310720 - 98 - 0 - 0 - - - 0x7f98880f4bb0 - client - 50 - 1582376 - 593208 - 1210489 - 1310720 - 98 - 0 - 0 - - - 0x7f98880f7620 - client - 50 - 1844520 - 559776 - 1312272 - 1572864 - 98 - 0 - 0 - - - 0x7f988803abb0 - client - 50 - 1844520 - 559776 - 1370136 - 1572864 - 98 - 0 - 0 - - - 0x7f989c54ec00 - client - 50 - 1582376 - 559776 - 1195200 - 1310720 - 98 - 0 - 0 - - - 0x7f988803ad20 - client - 50 - 1844520 - 565424 - 1365840 - 1572864 - 98 - 0 - 0 - - - 0x7f9880028a20 - client - 50 - 1844520 - 560856 - 1355512 - 1572864 - 98 - 0 - 0 - - - 0x7f989c5212c0 - client - 50 - 1582376 - 559776 - 1198529 - 1310720 - 98 - 0 - 0 - - - 0x7f98880e2f60 - client - 50 - 1844520 - 559776 - 1316144 - 1572864 - 98 - 0 - 0 - - - 0x7f9880009570 - client - 50 - 1582376 - 559776 - 1194393 - 1310720 - 98 - 0 - 0 - - - 0x7f98800096e0 - client - 50 - 1582376 - 559776 - 1239257 - 1310720 - 98 - 0 - 0 - - - 0x7f989c31de40 - client - 50 - 1582376 - 559776 - 1192952 - 1310720 - 98 - 0 - 0 - - - 0x7f9880028680 - client - 50 - 1582376 - 559776 - 1220792 - 1310720 - 98 - 0 - 0 - - - 0x7f9878315140 - res0 - 2 - 262144 - 5584 - 165984 - 262144 - 4 - 0 - 0 - - - 0x7f9879976310 - res1 - 1 - 524288 - 0 - 171680 - 524288 - 0 - 0 - 0 - - - 0x7f98799b5540 - res2 - 1 - 262144 - 0 - 65048 - 262144 - 0 - 0 - 0 - - - 0x7f98786d6170 - res3 - 1 - 262144 - 0 - 77456 - 262144 - 0 - 0 - 0 - - - 0x7f9878cfbf60 - res4 - 1 - 262144 - 0 - 115816 - 262144 - 0 - 0 - 0 - - - 0x7f9879b9d0e0 - res5 - 2 - 262144 - 10296 - 136304 - 262144 - 4 - 0 - 0 - - - 0x7f987998a4f0 - res6 - 1 - 262144 - 0 - 116032 - 262144 - 0 - 0 - 0 - - - 0x7f9879c69a60 - res7 - 1 - 262144 - 0 - 77600 - 262144 - 0 - 0 - 0 - - - 0x7f9879c6ebb0 - res8 - 2 - 524288 - 3664 - 382584 - 524288 - 4 - 0 - 0 - - - 0x7f9879c5f210 - res9 - 1 - 262144 - 0 - 75616 - 262144 - 0 - 0 - 0 - - - 0x7f9878316e00 - res10 - 2 - 262144 - 6536 - 105864 - 262144 - 4 - 0 - 0 - - - 0x7f9878686100 - res11 - 3 - 262144 - 10784 - 70000 - 262144 - 8 - 0 - 0 - - - 0x7f9879acc440 - res12 - 1 - 262144 - 0 - 103904 - 262144 - 0 - 0 - 0 - - - 0x7f9878019190 - res13 - 3 - 262144 - 18968 - 90968 - 262144 - 8 - 0 - 0 - - - 0x7f9878c9e480 - res14 - 1 - 262144 - 0 - 122456 - 262144 - 0 - 0 - 0 - - - 0x7f9879c09910 - res15 - 1 - 262144 - 0 - 80392 - 262144 - 0 - 0 - 0 - - - 0x7f98795a2a20 - res16 - 2 - 524288 - 5504 - 361968 - 524288 - 4 - 0 - 0 - - - 0x7f98795a2b90 - res17 - 1 - 262144 - 0 - 90696 - 262144 - 0 - 0 - 0 - - - 0x7f98795973b0 - res18 - 4 - 262144 - 14888 - 121024 - 262144 - 12 - 0 - 0 - - - 0x7f9879597520 - res19 - 1 - 262144 - 0 - 62888 - 262144 - 0 - 0 - 0 - - - 0x7f987807c8a0 - res20 - 4 - 262144 - 21472 - 126456 - 262144 - 12 - 0 - 0 - - - 0x7f987807ca10 - res21 - 1 - 262144 - 0 - 57848 - 262144 - 0 - 0 - 0 - - - 0x7f9878026990 - res22 - 1 - 262144 - 0 - 64152 - 262144 - 0 - 0 - 0 - - - 0x7f9878026b00 - res23 - 2 - 262144 - 6720 - 91008 - 262144 - 4 - 0 - 0 - - - 0x7f9878ca03b0 - res24 - 1 - 262144 - 0 - 73368 - 262144 - 0 - 0 - 0 - - - 0x7f9878ca0520 - res25 - 1 - 262144 - 0 - 129984 - 262144 - 0 - 0 - 0 - - - 0x7f98799a4f40 - res26 - 1 - 262144 - 0 - 98024 - 262144 - 0 - 0 - 0 - - - 0x7f98799a50b0 - res27 - 2 - 262144 - 6536 - 105888 - 262144 - 4 - 0 - 0 - - - 0x7f98786de000 - res28 - 1 - 262144 - 0 - 111944 - 262144 - 0 - 0 - 0 - - - 0x7f98786de170 - res29 - 2 - 262144 - 5568 - 66848 - 262144 - 4 - 0 - 0 - - - 0x7f98786a28c0 - res30 - 1 - 524288 - 0 - 191936 - 524288 - 0 - 0 - 0 - - - 0x7f98786a2a30 - ADB - 1 - 5971328 - 5501176 - 5590040 - 5767168 - 7 - 0 - 0 - - - 0x7f98786b3230 - res0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f98786b33a0 - res1 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879c53760 - res2 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879c538d0 - res3 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879a653e0 - res4 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879a65550 - res5 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879c499e0 - res6 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879c49b50 - res7 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f987868f520 - res8 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f987868f690 - res9 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879bf3640 - res10 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879bf37b0 - res11 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f987892ff20 - res12 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878930090 - res13 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878318920 - res14 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878318a90 - res15 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878318c00 - res16 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879b86750 - res17 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879b868c0 - res18 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9879b86a30 - res19 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878018770 - res20 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f98780188e0 - res21 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878018a50 - res22 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878315e10 - res23 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878315f80 - res24 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f98783160f0 - res25 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f98783198d0 - res26 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878319a40 - res27 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f9878319bb0 - res28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f987999f2a0 - res29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f987999f410 - res30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - 0x7f987999f580 - ADB - 1 - 425504 - 164872 - 164872 - 262144 - 7 - 0 - 0 - - - - 260021923 - 96486675 - 228589568 - 7756112 - 0 - - - - - From 60fe37e4ac41d616507a493c68bcd6ac17c554d0 Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Fri, 14 Apr 2023 17:03:02 +0200 Subject: [PATCH 2/4] Rename v3 fixtures directory to xml Also add .xml extensions to fixtures to make them more editor-friendly. Signed-off-by: Daniel Swarbrick --- bind_exporter_test.go | 8 ++++---- fixtures/{v3/server => xml/server.xml} | 0 fixtures/{v3/status => xml/status.xml} | 0 fixtures/{v3/tasks => xml/tasks.xml} | 0 fixtures/{v3/zones => xml/zones.xml} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename fixtures/{v3/server => xml/server.xml} (100%) rename fixtures/{v3/status => xml/status.xml} (100%) rename fixtures/{v3/tasks => xml/tasks.xml} (100%) rename fixtures/{v3/zones => xml/zones.xml} (100%) diff --git a/bind_exporter_test.go b/bind_exporter_test.go index 7d566ae8..436ebee8 100644 --- a/bind_exporter_test.go +++ b/bind_exporter_test.go @@ -165,10 +165,10 @@ func collect(c prometheus.Collector) ([]byte, error) { func newV3Server() *httptest.Server { m := map[string]string{ - "/xml/v3/server": "fixtures/v3/server", - "/xml/v3/status": "fixtures/v3/status", - "/xml/v3/tasks": "fixtures/v3/tasks", - "/xml/v3/zones": "fixtures/v3/zones", + "/xml/v3/server": "fixtures/xml/server.xml", + "/xml/v3/status": "fixtures/xml/status.xml", + "/xml/v3/tasks": "fixtures/xml/tasks.xml", + "/xml/v3/zones": "fixtures/xml/zones.xml", } return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if f, ok := m[r.RequestURI]; ok { diff --git a/fixtures/v3/server b/fixtures/xml/server.xml similarity index 100% rename from fixtures/v3/server rename to fixtures/xml/server.xml diff --git a/fixtures/v3/status b/fixtures/xml/status.xml similarity index 100% rename from fixtures/v3/status rename to fixtures/xml/status.xml diff --git a/fixtures/v3/tasks b/fixtures/xml/tasks.xml similarity index 100% rename from fixtures/v3/tasks rename to fixtures/xml/tasks.xml diff --git a/fixtures/v3/zones b/fixtures/xml/zones.xml similarity index 100% rename from fixtures/v3/zones rename to fixtures/xml/zones.xml From 5bc68c9ba7da1d5030b803f707cc92fbbb333648 Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Fri, 14 Apr 2023 19:14:55 +0200 Subject: [PATCH 3/4] Rename v3 package to xml Signed-off-by: Daniel Swarbrick --- bind/auto/auto.go | 4 ++-- bind/{v3/v3.go => xml/xml.go} | 2 +- bind_exporter.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) rename bind/{v3/v3.go => xml/xml.go} (99%) diff --git a/bind/auto/auto.go b/bind/auto/auto.go index c4a20c56..06ff6d09 100644 --- a/bind/auto/auto.go +++ b/bind/auto/auto.go @@ -17,7 +17,7 @@ import ( "net/http" "github.com/prometheus-community/bind_exporter/bind" - "github.com/prometheus-community/bind_exporter/bind/v3" + "github.com/prometheus-community/bind_exporter/bind/xml" ) // Client is a client which automatically detects the statistics version of the @@ -33,5 +33,5 @@ func NewClient(url string, c *http.Client) *Client { // Stats implements bind.Stats. func (c *Client) Stats(g ...bind.StatisticGroup) (bind.Statistics, error) { - return (&v3.Client{XMLClient: c.XMLClient}).Stats(g...) + return (&xml.Client{XMLClient: c.XMLClient}).Stats(g...) } diff --git a/bind/v3/v3.go b/bind/xml/xml.go similarity index 99% rename from bind/v3/v3.go rename to bind/xml/xml.go index fdd36863..cdf31ba9 100644 --- a/bind/v3/v3.go +++ b/bind/xml/xml.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v3 +package xml import ( "net/http" diff --git a/bind_exporter.go b/bind_exporter.go index ab0c77ee..04ffe6cb 100644 --- a/bind_exporter.go +++ b/bind_exporter.go @@ -30,7 +30,7 @@ import ( "github.com/prometheus-community/bind_exporter/bind" "github.com/prometheus-community/bind_exporter/bind/auto" "github.com/prometheus-community/bind_exporter/bind/json" - "github.com/prometheus-community/bind_exporter/bind/v3" + "github.com/prometheus-community/bind_exporter/bind/xml" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" @@ -403,8 +403,8 @@ func NewExporter(logger log.Logger, version, url string, timeout time.Duration, switch version { case "json": c = json.NewClient(url, &http.Client{Timeout: timeout}) - case "xml.v3": - c = v3.NewClient(url, &http.Client{Timeout: timeout}) + case "xml", "xml.v3": + c = xml.NewClient(url, &http.Client{Timeout: timeout}) default: c = auto.NewClient(url, &http.Client{Timeout: timeout}) } @@ -536,7 +536,7 @@ func main() { ).Default("/run/named/named.pid").String() bindVersion = kingpin.Flag("bind.stats-version", "BIND statistics version. Can be detected automatically.", - ).Default("auto").Enum("json", "xml.v3", "auto") + ).Default("auto").Enum("json", "xml", "xml.v3", "auto") metricsPath = kingpin.Flag( "web.telemetry-path", "Path under which to expose metrics", ).Default("/metrics").String() From 720b399467959092bd452b6bdf4eb2706fb4d58f Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Fri, 14 Apr 2023 20:25:57 +0200 Subject: [PATCH 4/4] Default to JSON statistics channel This also drops support for "auto" determination of stats version, which is too tightly coupled to the XML stats channel to easily support JSON too. It is essentially redundant anyway, since the JSON stats channel is supported and always present since BIND v9.10.0. We also no longer unmarshal the memory or socketmgr nodes of the XML stats, since we don't currently expose any metrics for these, and they have been responsible for unmarshal errors in the past. Once we actually _do_ expose metrics for them, they should be included in tests. Signed-off-by: Daniel Swarbrick --- bind/auto/auto.go | 37 -------------------------------- bind/bind.go | 46 ---------------------------------------- bind/xml/xml.go | 49 ++++++++++++++++++++++++++++++++++++------- bind_exporter.go | 9 +++----- bind_exporter_test.go | 9 -------- 5 files changed, 44 insertions(+), 106 deletions(-) delete mode 100644 bind/auto/auto.go diff --git a/bind/auto/auto.go b/bind/auto/auto.go deleted file mode 100644 index 06ff6d09..00000000 --- a/bind/auto/auto.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package auto - -import ( - "net/http" - - "github.com/prometheus-community/bind_exporter/bind" - "github.com/prometheus-community/bind_exporter/bind/xml" -) - -// Client is a client which automatically detects the statistics version of the -// BIND server and delegates the request to the correct versioned client. -type Client struct { - *bind.XMLClient -} - -// NewClient returns an initialized Client. -func NewClient(url string, c *http.Client) *Client { - return &Client{XMLClient: bind.NewXMLClient(url, c)} -} - -// Stats implements bind.Stats. -func (c *Client) Stats(g ...bind.StatisticGroup) (bind.Statistics, error) { - return (&xml.Client{XMLClient: c.XMLClient}).Stats(g...) -} diff --git a/bind/bind.go b/bind/bind.go index edfdd8c2..c2379b44 100644 --- a/bind/bind.go +++ b/bind/bind.go @@ -14,11 +14,6 @@ package bind import ( - "encoding/xml" - "fmt" - "net/http" - "net/url" - "path" "time" ) @@ -28,47 +23,6 @@ type Client interface { Stats(...StatisticGroup) (Statistics, error) } -// XMLClient is a generic BIND API client to retrieve statistics in XML format. -type XMLClient struct { - url string - http *http.Client -} - -// NewXMLClient returns an initialized XMLClient. -func NewXMLClient(url string, c *http.Client) *XMLClient { - return &XMLClient{ - url: url, - http: c, - } -} - -// Get queries the given path and stores the result in the value pointed to by -// v. The endpoint must return a valid XML representation which can be -// unmarshaled into the provided value. -func (c *XMLClient) Get(p string, v interface{}) error { - u, err := url.Parse(c.url) - if err != nil { - return fmt.Errorf("invalid URL %q: %s", c.url, err) - } - u.Path = path.Join(u.Path, p) - - resp, err := c.http.Get(u.String()) - if err != nil { - return fmt.Errorf("error querying stats: %s", err) - } - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("unexpected status for %q: %s", u, resp.Status) - } - - if err := xml.NewDecoder(resp.Body).Decode(v); err != nil { - return fmt.Errorf("failed to unmarshal XML response: %s", err) - } - - return nil -} - const ( // QryRTT is the common prefix of query round-trip histogram counters. QryRTT = "QryRTT" diff --git a/bind/xml/xml.go b/bind/xml/xml.go index cdf31ba9..cfa357c8 100644 --- a/bind/xml/xml.go +++ b/bind/xml/xml.go @@ -14,7 +14,11 @@ package xml import ( + "encoding/xml" + "fmt" "net/http" + "net/url" + "path" "time" "github.com/prometheus-community/bind_exporter/bind" @@ -40,11 +44,9 @@ const ( ) type Statistics struct { - Memory struct{} `xml:"memory"` - Server Server `xml:"server"` - Socketmgr struct{} `xml:"socketmgr"` - Taskmgr bind.TaskManager `xml:"taskmgr"` - Views []View `xml:"views>view"` + Server Server `xml:"server"` + Taskmgr bind.TaskManager `xml:"taskmgr"` + Views []View `xml:"views>view"` } type ZoneStatistics struct { @@ -84,14 +86,45 @@ type ZoneCounter struct { Serial string `xml:"serial"` } -// Client implements bind.Client and can be used to query a BIND v3 API. +// Client implements bind.Client and can be used to query a BIND XML v3 API. type Client struct { - *bind.XMLClient + url string + http *http.Client } // NewClient returns an initialized Client. func NewClient(url string, c *http.Client) *Client { - return &Client{XMLClient: bind.NewXMLClient(url, c)} + return &Client{ + url: url, + http: c, + } +} + +// Get queries the given path and stores the result in the value pointed to by +// v. The endpoint must return a valid XML representation which can be +// unmarshaled into the provided value. +func (c *Client) Get(p string, v interface{}) error { + u, err := url.Parse(c.url) + if err != nil { + return fmt.Errorf("invalid URL %q: %s", c.url, err) + } + u.Path = path.Join(u.Path, p) + + resp, err := c.http.Get(u.String()) + if err != nil { + return fmt.Errorf("error querying stats: %s", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("unexpected status %s", resp.Status) + } + + if err := xml.NewDecoder(resp.Body).Decode(v); err != nil { + return fmt.Errorf("failed to unmarshal XML response: %s", err) + } + + return nil } // Stats implements bind.Stats. diff --git a/bind_exporter.go b/bind_exporter.go index 04ffe6cb..16b9d50d 100644 --- a/bind_exporter.go +++ b/bind_exporter.go @@ -28,7 +28,6 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus-community/bind_exporter/bind" - "github.com/prometheus-community/bind_exporter/bind/auto" "github.com/prometheus-community/bind_exporter/bind/json" "github.com/prometheus-community/bind_exporter/bind/xml" "github.com/prometheus/client_golang/prometheus" @@ -401,12 +400,10 @@ type Exporter struct { func NewExporter(logger log.Logger, version, url string, timeout time.Duration, g []bind.StatisticGroup) *Exporter { var c bind.Client switch version { - case "json": - c = json.NewClient(url, &http.Client{Timeout: timeout}) case "xml", "xml.v3": c = xml.NewClient(url, &http.Client{Timeout: timeout}) default: - c = auto.NewClient(url, &http.Client{Timeout: timeout}) + c = json.NewClient(url, &http.Client{Timeout: timeout}) } var cs []collectorConstructor @@ -535,8 +532,8 @@ func main() { "Path to BIND's pid file to export process information", ).Default("/run/named/named.pid").String() bindVersion = kingpin.Flag("bind.stats-version", - "BIND statistics version. Can be detected automatically.", - ).Default("auto").Enum("json", "xml", "xml.v3", "auto") + "BIND statistics channel", + ).Default("json").Enum("json", "xml", "xml.v3", "auto") metricsPath = kingpin.Flag( "web.telemetry-path", "Path under which to expose metrics", ).Default("/metrics").String() diff --git a/bind_exporter_test.go b/bind_exporter_test.go index 436ebee8..98f09bba 100644 --- a/bind_exporter_test.go +++ b/bind_exporter_test.go @@ -90,15 +90,6 @@ func TestBindExporterV3Client(t *testing.T) { }.run(t) } -func TestBindExporterAutomaticClient(t *testing.T) { - bindExporterTest{ - server: newV3Server(), - groups: []bind.StatisticGroup{bind.ServerStats}, - version: "auto", - include: combine([]string{`bind_up 1`}, serverStats), - }.run(t) -} - func TestBindExporterBindFailure(t *testing.T) { bindExporterTest{ server: httptest.NewServer(http.HandlerFunc(http.NotFound)),