chore(go.d/sd): make module optional in the template (#21273)
Ilya Mashchenko committed
Nov 6, 2025 at 19:44 UTC
b21e0b251bb180c49685d307ca87a69d83cc10ea
6 files changed
+53
-143
src/go/plugin/go.d/agent/discovery/sd/pipeline/pipeline_test.go
+22
-1
@@ -210,7 +210,7 @@ services:
210
wantComposeCalls: 2, // compose called per target (2 targets)
211
wantConfGroups: []*confgroup.Group{
212
// same expected configs as the legacy "new group with targets"
213
- prepareDiscoveredGroup("mock1-foobar1", "mock2-foobar2"),
213
+ prepareDiscoveredGroupWithModule("mock1-foobar1", "svc-foobar1", "mock2-foobar2", "svc-foobar2"),
214
},
215
},
216
}
@@ -239,6 +239,27 @@ func prepareDiscoveredGroup(configNames ...string) *confgroup.Group {
239
}
240
}
241
242
+func prepareDiscoveredGroupWithModule(values ...string) *confgroup.Group {
243
+ var configs []confgroup.Config
244
+
245
+ for i := 0; i < len(values); i += 2 {
246
+ cfgName := values[i]
247
+ modName := values[i+1]
248
+ configs = append(configs, confgroup.Config{}.
249
+ SetProvider("mock").
250
+ SetSourceType(confgroup.TypeDiscovered).
251
+ SetSource("test").
252
+ SetName(cfgName).
253
+ SetModule(modName),
254
+ )
255
+ }
256
+
257
+ return &confgroup.Group{
258
+ Source: "test",
259
+ Configs: configs,
260
+ }
261
+}
262
+
263
func newMockDiscoverer(tags string, tggs ...model.TargetGroup) *mockDiscoverer {
264
return &mockDiscoverer{
265
tags: mustParseTags(tags),
src/go/plugin/go.d/agent/discovery/sd/pipeline/services.go
+6
@@ -97,6 +97,12 @@ func (s *serviceEngine) compose(tgt model.Target) []confgroup.Config {
97
continue
98
}
99
100
+ for _, cfg := range cfgs {
101
+ if cfg.Module() == "" {
102
+ cfg.SetModule(r.id)
103
+ }
104
+ }
105
+
106
out = append(out, cfgs...)
107
}
108
src/go/plugin/go.d/agent/discovery/sd/pipeline/services_test.go
+6
-6
@@ -79,24 +79,24 @@ func TestServiceEngine_compose(t *testing.T) {
79
configYAML: configA,
80
target: newMockTarget("mock1"),
81
wantConfigs: []confgroup.Config{
82
- {"name": "mock1-1"},
82
+ {"name": "mock1-1", "module": "rule1"},
83
},
84
},
85
"one rule -> two configs (YAML list)": {
86
configYAML: configA,
87
target: newMockTarget("mock2"),
88
wantConfigs: []confgroup.Config{
89
- {"name": "mock2-2"},
90
- {"name": "mock2-3"},
89
+ {"name": "mock2-2", "module": "rule2"},
90
+ {"name": "mock2-3", "module": "rule2"},
91
},
92
},
93
"multiple rules aggregated (no drop before)": {
94
configYAML: configA,
95
target: newMockTarget("mock3"),
96
wantConfigs: []confgroup.Config{
97
- {"name": "mock3-2"},
98
- {"name": "mock3-3"},
99
- {"name": "mock3-4"},
97
+ {"name": "mock3-2", "module": "rule2"},
98
+ {"name": "mock3-3", "module": "rule2"},
99
+ {"name": "mock3-4", "module": "rule3"},
100
},
101
},
102
"hard drop stops further evaluation": {
src/go/plugin/go.d/config/go.d/sd/docker.conf
+6
-46
@@ -20,70 +20,60 @@ services:
20
- id: "apache"
21
match: '{{ match "sp" .Image "httpd httpd:* */apache */apache:* */apache2 */apache2:*" }}'
22
config_template: |
23
- module: apache
23
name: docker_{{.Name}}
24
url: http://{{.Address}}/server-status?auto
25
26
- id: "beanstalk"
27
match: '{{ match "sp" .Image "*/beanstalkd */beanstalkd:*" }}'
28
config_template: |
30
- module: beanstalk
29
name: docker_{{.Name}}
30
address: {{.Address}}
31
32
- id: "boinc"
33
match: '{{ match "sp" .Image "boinc/client boinc/client:* */boinc */boinc:*" }}'
34
config_template: |
37
- module: boinc
35
name: docker_{{.Name}}
36
address: {{.Address}}
37
38
- id: "cockroachdb"
39
match: '{{ match "sp" .Image "cockroachdb/cockroach cockroachdb/cockroach:*" }}'
40
config_template: |
44
- module: cockroachdb
41
name: docker_{{.Name}}
42
url: http://{{.Address}}/_status/vars
43
44
- id: "consul"
45
match: '{{ match "sp" .Image "consul consul:* */consul */consul:*" }}'
46
config_template: |
51
- module: consul
47
name: docker_{{.Name}}
48
url: http://{{.Address}}
49
50
- id: "coredns"
51
match: '{{ match "sp" .Image "*/coredns */coredns:*" }}'
52
config_template: |
58
- module: coredns
53
name: docker_{{.Name}}
54
url: http://{{.Address}}/metrics
55
56
- id: "couchbase"
57
match: '{{ or (eq .PrivatePort "8091") (match "sp" .Image "couchbase couchbase:*") }}'
58
config_template: |
65
- module: couchbase
59
name: docker_{{.Name}}
60
url: http://{{.Address}}
61
62
- id: "couchdb"
63
match: '{{ or (eq .PrivatePort "5984") (match "sp" .Image "couchdb couchdb:*") }}'
64
config_template: |
72
- module: couchdb
65
name: docker_{{.Name}}
66
url: http://{{.Address}}
67
68
- id: "dovecot"
69
match: '{{ or (eq .PrivatePort "24242") (match "sp" .Image "*/dovecot */dovecot:*") }}'
70
config_template: |
79
- module: dovecot
71
name: docker_{{.Name}}
72
address: {{.Address}}
73
74
- id: "elasticsearch"
75
match: '{{ or (eq .PrivatePort "9200") (match "sp" .Image "elasticsearch elasticsearch:* */elasticsearch */elasticsearch:* */opensearch */opensearch:*") }}'
76
config_template: |
86
- module: elasticsearch
77
name: docker_{{.Name}}
78
{{ if glob .Image "*elastic*" -}}
79
url: http://{{.Address}}
@@ -97,86 +87,72 @@ services:
87
- id: "gearman"
88
match: '{{ and (eq .PrivatePort "4730") (match "sp" .Image "*/gearmand */gearmand:*") }}'
89
config_template: |
100
- module: gearman
90
name: docker_{{.Name}}
91
address: {{.Address}}
92
93
- id: "ipfs"
94
match: '{{ and (eq .PrivatePort "5001") (match "sp" .Image "ipfs/kubo ipfs/kubo:*") }}'
95
config_template: |
107
- module: ipfs
96
name: docker_{{.Name}}
97
url: http://{{.Address}}
98
99
- id: "lighttpd"
100
match: '{{ match "sp" .Image "*/lighttpd */lighttpd:*" }}'
101
config_template: |
114
- module: lighttpd
102
name: docker_{{.Name}}
103
url: http://{{.Address}}/server-status?auto
104
105
- id: "maxscale"
106
match: '{{ or (eq .PrivatePort "8989") (match "sp" .Image "mariadb/maxscale mariadb/maxscale:*") }}'
107
config_template: |
121
- module: maxscale
108
name: docker_{{.Name}}
109
url: http://{{.Address}}
110
111
- id: "memcached"
112
match: '{{ or (eq .PrivatePort "11211") (match "sp" .Image "memcached memcached:* */memcached */memcached:*") }}'
113
config_template: |
128
- module: memcached
114
name: docker_{{.Name}}
115
address: {{.Address}}
116
117
- id: "mongodb"
118
match: '{{ or (eq .PrivatePort "27017") (match "sp" .Image "mongo mongo:* */mongodb */mongodb:* */mongodb-community-server */mongodb-community-server:*") }}'
119
config_template: |
135
- module: mongodb
120
name: docker_{{.Name}}
121
uri: mongodb://{{.Address}}
122
123
- id: "mysql"
124
match: '{{ or (eq .PrivatePort "3306") (match "sp" .Image "mysql mysql:* */mysql */mysql:* mariadb mariadb:* */mariadb */mariadb:* percona percona:* */percona-mysql */percona-mysql:*") }}'
125
config_template: |
142
- module: mysql
126
name: docker_{{.Name}}
127
dsn: netdata@tcp({{.Address}})/
128
129
- id: "nats"
130
match: '{{ and (eq .PrivatePort "8222") (match "sp" .Image "nats nats:*") }}'
131
config_template: |
149
- - module: nats
150
- name: docker_{{.Name}}
132
+ - name: docker_{{.Name}}
133
url: http://{{.Address}}
134
135
- id: "nginx"
136
match: '{{ match "sp" .Image "nginx nginx:*" }}'
137
config_template: |
156
- - module: nginx
157
- name: docker_{{.Name}}
138
+ - name: docker_{{.Name}}
139
url: http://{{.Address}}/stub_status
159
- - module: nginx
160
- name: docker_{{.Name}}
140
+ - name: docker_{{.Name}}
141
url: http://{{.Address}}/basic_status
162
- - module: nginx
163
- name: docker_{{.Name}}
142
+ - name: docker_{{.Name}}
143
url: http://{{.Address}}/nginx_status
165
- - module: nginx
166
- name: docker_{{.Name}}
144
+ - name: docker_{{.Name}}
145
url: http://{{.Address}}/status
146
147
- id: "nginxunit"
148
match: '{{ match "sp" .Image "nginx/unit nginx/unit:*" }}'
149
config_template: |
172
- - module: nginxunit
173
- name: docker_{{.Name}}
150
+ - name: docker_{{.Name}}
151
url: http://{{.Address}}
152
153
- id: "oracledb"
154
match: '{{ and (eq .PrivatePort "1521" "2484") (match "sp" .Image "oracle/database oracle/database:*") }}'
155
config_template: |
179
- module: oracledb
156
name: docker_{{.Name}}
157
{{ if eq .PrivatePort "1521" -}}
158
dsn: 'oracle://username:password@{{.Address}}/XE'
@@ -187,14 +163,12 @@ services:
163
- id: "pgbouncer"
164
match: '{{ or (eq .PrivatePort "6432") (match "sp" .Image "*/pgbouncer */pgbouncer:*") }}'
165
config_template: |
190
- module: pgbouncer
166
name: docker_{{.Name}}
167
dsn: postgres://netdata:postgres@{{.Address}}/pgbouncer
168
169
- id: "pika"
170
match: '{{ match "sp" .Image "pikadb/pika pikadb/pika:*" }}'
171
config_template: |
197
- module: pika
172
name: docker_{{.Name}}
173
address: redis://@{{.Address}}
174
@@ -208,14 +182,12 @@ services:
182
- id: "proxysql"
183
match: '{{ or (eq .PrivatePort "6032") (match "sp" .Image "*/proxysql */proxysql:*") }}'
184
config_template: |
211
- module: proxysql
185
name: docker_{{.Name}}
186
dsn: stats:stats@tcp({{.Address}})/
187
188
- id: "puppet"
189
match: '{{ or (eq .PrivatePort "8140") (match "sp" .Image "puppet/puppetserver puppet/puppetserver:*") }}'
190
config_template: |
218
- module: puppet
191
name: docker_{{.Name}}
192
url: https://{{.Address}}
193
tls_skip_verify: yes
@@ -223,56 +195,48 @@ services:
195
- id: "rabbitmq"
196
match: '{{ or (eq .PrivatePort "15672") (match "sp" .Image "rabbitmq rabbitmq:* */rabbitmq */rabbitmq:*") }}'
197
config_template: |
226
- module: rabbitmq
198
name: docker_{{.Name}}
199
url: http://{{.Address}}
200
201
- id: "redis"
202
match: '{{ or (eq .PrivatePort "6379") (match "sp" .Image "redis redis:* */redis */redis:*") }}'
203
config_template: |
233
- module: redis
204
name: docker_{{.Name}}
205
address: redis://@{{.Address}}
206
207
- id: "rethinkdb"
208
match: '{{ and (eq .PrivatePort "28015") (match "sp" .Image "rethinkdb rethinkdb:* */rethinkdb */rethinkdb:*") }}'
209
config_template: |
240
- module: rethinkdb
210
name: docker_{{.Name}}
211
address: {{.Address}}
212
213
- id: "squid"
214
match: '{{ match "sp" .Image "*/squid */squid:*" }}'
215
config_template: |
247
- module: squid
216
name: docker_{{.Name}}
217
url: http://{{.Address}}
218
219
- id: "tengine"
220
match: '{{ match "sp" .Image "*/tengine */tengine:*" }}'
221
config_template: |
254
- module: tengine
222
name: docker_{{.Name}}
223
url: http://{{.Address}}/us
224
225
- id: "tor"
226
match: '{{ and (eq .PrivatePort "9051") (match "sp" .Image "*/tor */tor:*") }}'
227
config_template: |
261
- module: tor
228
name: docker_{{.Name}}
229
address: {{.Address}}
230
231
- id: "tomcat"
232
match: '{{ match "sp" .Image "tomcat tomcat:* */tomcat */tomcat:*" }}'
233
config_template: |
268
- module: tomcat
234
name: docker_{{.Name}}
235
url: http://{{.Address}}
236
237
- id: "typesense"
238
match: '{{ match "sp" .Image "typesense/typesense typesense/typesense:*" }}'
239
config_template: |
275
- module: typesense
240
name: docker_{{.Name}}
241
url: http://{{.Address}}
242
api_key: {{ trimPrefix "--api-key=" (regexFind "--api-key=[^ ]+" .Command) -}}
@@ -280,21 +244,17 @@ services:
244
- id: "varnish"
245
match: '{{ match "sp" .Image "varnish varnish:*" }}'
246
config_template: |
283
- module: varnish
247
name: docker_{{.Name}}
248
docker_container: {{.Name}}
249
250
- id: "vernemq"
251
match: '{{ match "sp" .Image "*/vernemq */vernemq:*" }}'
252
config_template: |
290
- module: vernemq
253
name: docker_{{.Name}}
254
url: http://{{.Address}}/metrics
255
256
- id: "zookeeper"
257
match: '{{ or (eq .PrivatePort "2181") (match "sp" .Image "*/zookeeper */zookeeper:*") }}'
258
config_template: |
297
- module: zookeeper
259
name: docker_{{.Name}}
260
address: {{.Address}}
300
-
src/go/plugin/go.d/config/go.d/sd/net_listeners.conf
+13
-89
@@ -11,7 +11,6 @@ services:
11
- id: "activemq"
12
match: '{{ and (eq .Port "8161") (eq .Comm "activemq") }}'
13
config_template: |
14
- module: activemq
14
name: local
15
url: http://{{.Address}}
16
webadmin: admin
@@ -19,98 +18,84 @@ services:
18
- id: "apache"
19
match: '{{ and (eq .Port "80" "8080") (eq .Comm "apache" "apache2" "httpd") }}'
20
config_template: |
22
- module: apache
21
name: local
22
url: http://{{.Address}}/server-status?auto
23
24
- id: "apcupsd"
25
match: '{{ or (eq .Port "3551") (eq .Comm "apcupsd") }}'
26
config_template: |
29
- module: apcupsd
27
name: local_{{.Port}}
28
address: {{.Address}}
29
30
- id: "beanstalk"
31
match: '{{ or (eq .Port "11300") (eq .Comm "beanstalkd") }}'
32
config_template: |
36
- module: beanstalk
33
name: local
34
address: {{.Address}}
35
36
- id: "bind"
37
match: '{{ and (eq .Port "8653") (eq .Comm "bind" "named") }}'
38
config_template: |
43
- module: bind
39
name: local
40
url: http://{{.Address}}/json/v1
41
42
- id: "boinc"
43
match: '{{ and (eq .Port "31416") (eq .Comm "boinc") }}'
44
config_template: |
50
- module: boinc
45
name: local
46
address: {{.Address}}
47
48
- id: "cassandra"
49
match: '{{ and (eq .Port "7072") (glob .Cmdline "*cassandra*") }}'
50
config_template: |
57
- module: cassandra
51
name: local
52
url: http://{{.Address}}/metrics
53
54
- id: "ceph"
55
match: '{{ and (eq .Port "8443") (eq .Comm "ceph-mgr") }}'
56
config_template: |
64
- module: ceph
57
name: local
58
url: https://{{.Address}}
59
60
- id: "chrony"
61
match: '{{ and (eq .Port "323") (eq .Comm "chronyd") }}'
62
config_template: |
71
- module: chrony
63
name: local
64
address: {{.Address}}
65
66
- id: "clickhouse"
67
match: '{{ and (eq .Port "8123") (eq .Comm "clickhouse-server") }}'
68
config_template: |
78
- module: clickhouse
69
name: local
70
url: http://{{.Address}}
71
72
- id: "cockroachdb"
73
match: '{{ and (eq .Port "8080") (eq .Comm "cockroach") }}'
74
config_template: |
85
- module: cockroachdb
75
name: local
76
url: http://{{.Address}}/_status/vars
77
78
- id: "consul"
79
match: '{{ and (eq .Port "8500") (eq .Comm "consul") }}'
80
config_template: |
92
- module: consul
81
name: local
82
url: http://{{.Address}}
83
84
- id: "coredns"
85
match: '{{ and (eq .Port "9153") (eq .Comm "coredns") }}'
86
config_template: |
99
- module: coredns
87
name: local
88
url: http://{{.Address}}/metrics
89
90
- id: "couchbase"
91
match: '{{ or (eq .Port "8091") (glob .Cmdline "*couchbase*") }}'
92
config_template: |
106
- module: couchbase
93
name: local
94
url: http://{{.Address}}
95
96
- id: "couchdb"
97
match: '{{ or (eq .Port "5984") (glob .Cmdline "*couchdb*") }}'
98
config_template: |
113
- module: couchdb
99
name: local
100
url: http://{{.Address}}
101
node: '_local'
@@ -118,7 +103,6 @@ services:
103
- id: "dnsdist"
104
match: '{{ and (eq .Port "8083") (eq .Comm "dnsdist") }}'
105
config_template: |
121
- module: dnsdist
106
name: local
107
url: http://{{.Address}}
108
headers:
@@ -127,7 +111,6 @@ services:
111
- id: "dnsmasq"
112
match: '{{ and (eq .Protocol "UDP") (eq .Port "53") (eq .Comm "dnsmasq") }}'
113
config_template: |
130
- module: dnsmasq
114
name: local
115
protocol: udp
116
address: {{.Address}}
@@ -135,21 +118,18 @@ services:
118
- id: "docker_engine"
119
match: '{{ and (eq .Port "9323") (eq .Comm "dockerd") }}'
120
config_template: |
138
- module: docker_engine
121
name: local
122
url: http://{{.Address}}/metrics
123
124
- id: "dovecot"
125
match: '{{ and (eq .Port "24242") (eq .Comm "dovecot") }}'
126
config_template: |
145
- module: dovecot
127
name: local
128
address: {{.Address}}
129
130
- id: "elasticsearch"
131
match: '{{ or (eq .Port "9200") (glob .Cmdline "*elasticsearch*" "*opensearch*") }}'
132
config_template: |
152
- module: elasticsearch
133
name: local
134
{{ if glob .Cmdline "*elastic*" -}}
135
url: http://{{.Address}}
@@ -163,21 +143,18 @@ services:
143
- id: "envoy"
144
match: '{{ and (eq .Port "9901") (eq .Comm "envoy") }}'
145
config_template: |
166
- module: envoy
146
name: local
147
url: http://{{.Address}}/stats/prometheus
148
149
- id: "fluentd"
150
match: '{{ and (eq .Port "24220") (glob .Cmdline "*fluentd*") }}'
151
config_template: |
173
- module: fluentd
152
name: local
153
url: http://{{.Address}}
154
155
- id: "freeradius"
156
match: '{{ and (eq .Port "18121") (eq .Comm "freeradius") }}'
157
config_template: |
180
- module: freeradius
158
name: local
159
address: {{.IPAddress}}
160
port: {{.Port}}
@@ -186,28 +163,24 @@ services:
163
- id: "gearman"
164
match: '{{ or (eq .Port "4730") (eq .Comm "gearmand") }}'
165
config_template: |
189
- module: gearman
166
name: local
167
address: {{.Address}}
168
169
- id: "geth"
170
match: '{{ and (eq .Port "6060") (eq .Comm "geth") }}'
171
config_template: |
196
- module: geth
172
name: local
173
url: http://{{.Address}}/debug/metrics/prometheus
174
175
- id: "haproxy"
176
match: '{{ and (eq .Port "8404") (eq .Comm "haproxy") }}'
177
config_template: |
203
- module: haproxy
178
name: local
179
url: http://{{.Address}}/metrics
180
181
- id: "hddtemp"
182
match: '{{ and (eq .Port "7634") (eq .Comm "hddtemp") }}'
183
config_template: |
210
- module: hddtemp
184
name: local
185
address: {{.Address}}
186
@@ -228,21 +201,18 @@ services:
201
- id: "icecast"
202
match: '{{ and (eq .Port "8000") (eq .Comm "icecast") }}'
203
config_template: |
231
- module: icecast
204
name: local
205
url: http://{{.Address}}
206
207
- id: "ipfs"
208
match: '{{ and (eq .Port "5001") (eq .Comm "ipfs") }}'
209
config_template: |
238
- module: ipfs
210
name: local
211
url: http://{{.Address}}
212
242
- - id: "kubelet"
213
+ - id: "k8s_kubelet"
214
match: '{{ and (eq .Port "10250" "10255") (eq .Comm "kubelet") }}'
215
config_template: |
245
- module: k8s_kubelet
216
name: local
217
{{- if eq .Port "10255" }}
218
url: http://{{.Address}}/metrics
@@ -251,52 +221,45 @@ services:
221
tls_skip_verify: yes
222
{{- end }}
223
254
- - id: "kubeproxy"
224
+ - id: "k8s_kubeproxy"
225
match: '{{ and (eq .Port "10249") (eq .Comm "kube-proxy") }}'
226
config_template: |
257
- module: k8s_kubeproxy
227
name: local
228
url: http://{{.Address}}/metrics
229
230
- id: "lighttpd"
231
match: '{{ and (eq .Port "80" "8080") (eq .Comm "lighttpd") }}'
232
config_template: |
264
- module: lighttpd
233
name: local
234
url: http://{{.Address}}/server-status?auto
235
236
- id: "logstash"
237
match: '{{ and (eq .Port "9600") (glob .Cmdline "*logstash*") }}'
238
config_template: |
271
- module: logstash
239
name: local
240
url: http://{{.Address}}
241
242
- id: "maxscale"
243
match: '{{ or (eq .Port "8989") (eq .Comm "maxscale") }}'
244
config_template: |
278
- module: maxscale
245
name: local
246
url: http://{{.Address}}
247
248
- id: "memcached"
249
match: '{{ or (eq .Port "11211") (eq .Comm "memcached") }}'
250
config_template: |
285
- module: memcached
251
name: local
252
address: {{.Address}}
253
254
- id: "mongodb"
255
match: '{{ or (eq .Port "27017") (eq .Comm "mongod") }}'
256
config_template: |
292
- module: mongodb
257
name: local
258
uri: mongodb://{{.Address}}
259
260
- id: "monit"
261
match: '{{ or (eq .Port "2812") (eq .Comm "monit") }}'
262
config_template: |
299
- module: monit
263
name: local
264
url: http://{{.Address}}
265
username: admin
@@ -305,47 +268,38 @@ services:
268
- id: "mysql"
269
match: '{{ or (eq .Port "3306") (eq .Comm "mysqld" "mariadbd") }}'
270
config_template: |
308
- - module: mysql
309
- name: local
271
+ - name: local
272
dsn: netdata@unix(/var/run/mysqld/mysqld.sock)/
311
- - module: mysql
312
- name: local
273
+ - name: local
274
dsn: netdata@tcp({{.Address}})/
275
276
- id: "nats"
277
match: '{{ and (eq .Port "8222") (eq .Comm "nats-server") }}'
278
config_template: |
318
- - module: nats
319
- name: local
279
+ - name: local
280
url: http://{{.Address}}
281
282
- id: "nginx"
283
match: '{{ and (eq .Port "80" "8080") (eq .Comm "nginx") }}'
284
config_template: |
325
- - module: nginx
326
- name: local
285
+ - name: local
286
url: http://{{.Address}}/stub_status
328
- - module: nginx
329
- name: local
287
+ - name: local
288
url: http://{{.Address}}/basic_status
331
- - module: nginx
332
- name: local
289
+ - name: local
290
url: http://{{.Address}}/nginx_status
334
- - module: nginx
335
- name: local
291
+ - name: local
292
url: http://{{.Address}}/status
293
294
- id: "nginxunit"
295
match: '{{ and (eq .Port "8000") (eq .Comm "unit") }}'
296
config_template: |
341
- - module: nginxunit
342
- name: local
297
+ - name: local
298
url: http://{{.Address}}
299
300
- id: "ntpd"
301
match: '{{ or (eq .Port "123") (eq .Comm "ntpd") }}'
302
config_template: |
348
- module: ntpd
303
name: local
304
address: {{.Address}}
305
collect_peers: no
@@ -353,21 +307,18 @@ services:
307
- id: "openldap"
308
match: '{{ eq .Comm "slapd" }}'
309
config_template: |
356
- module: openldap
310
name: local
311
url: ldap://{{.Address}}
312
313
- id: "openvpn"
314
match: '{{ and (eq .Port "7505") (eq .Comm "openvpn") }}'
315
config_template: |
363
- module: openvpn
316
name: local
317
address: {{.Address}}
318
319
- id: "oracledb"
320
match: '{{ and (eq .Port "1521" "2484") (eq .Comm "tnslsnr") }}'
321
config_template: |
370
- module: oracledb
322
name: local
323
{{ if eq .Port "1521" -}}
324
dsn: 'oracle://username:password@{{.Address}}/XE'
@@ -378,41 +329,34 @@ services:
329
- id: "pgbouncer"
330
match: '{{ or (eq .Port "6432") (eq .Comm "pgbouncer") }}'
331
config_template: |
381
- module: pgbouncer
332
name: local
333
dsn: postgres://netdata:postgres@{{.Address}}/pgbouncer
334
335
- id: "pihole"
336
match: '{{ and (eq .Port "80") (eq .Comm "pihole-FTL") }}'
337
config_template: |
388
- module: pihole
338
name: local
339
url: http://{{.Address}}
340
341
- id: "pika"
342
match: '{{ and (eq .Port "9221") (eq .Comm "pika") }}'
343
config_template: |
395
- module: pika
344
name: local
345
address: redis://@{{.IPAddress}}:{{.Port}}
346
347
- id: "postgres"
348
match: '{{ or (eq .Port "5432") (eq .Comm "postgres") }}'
349
config_template: |
402
- - module: postgres
403
- name: local
350
+ - name: local
351
dsn: 'host=/var/run/postgresql dbname=postgres user=postgres'
405
- - module: postgres
406
- name: local
352
+ - name: local
353
dsn: 'host=/var/run/postgresql dbname=postgres user=netdata'
408
- - module: postgres
409
- name: local
354
+ - name: local
355
dsn: postgresql://netdata@{{.Address}}/postgres
356
357
- id: "powerdns"
358
match: '{{ and (eq .Port "8081") (eq .Comm "pdns_server") }}'
359
config_template: |
415
- module: powerdns
360
name: local
361
url: http://{{.Address}}
362
headers:
@@ -421,7 +365,6 @@ services:
365
- id: "powerdns_recursor"
366
match: '{{ and (eq .Port "8081") (eq .Comm "pdns_recursor") }}'
367
config_template: |
424
- module: powerdns_recursor
368
name: local
369
url: http://{{.Address}}
370
headers:
@@ -430,14 +373,12 @@ services:
373
- id: "proxysql"
374
match: '{{ or (eq .Port "6032") (eq .Comm "proxysql") }}'
375
config_template: |
433
- module: proxysql
376
name: local
377
dsn: stats:stats@tcp({{.Address}})/
378
379
- id: "puppet"
380
match: '{{ or (eq .Port "8140") (glob .Cmdline "*puppet-server*") }}'
381
config_template: |
440
- module: puppet
382
name: local
383
url: https://{{.Address}}
384
tls_skip_verify: yes
@@ -445,7 +386,6 @@ services:
386
- id: "rabbitmq"
387
match: '{{ or (eq .Port "15672") (glob .Cmdline "*rabbitmq*") }}'
388
config_template: |
448
- module: rabbitmq
389
name: local
390
url: http://{{.Address}}
391
username: guest
@@ -455,77 +395,66 @@ services:
395
- id: "redis"
396
match: '{{ or (eq .Port "6379") (eq .Comm "redis-server") }}'
397
config_template: |
458
- module: redis
398
name: local
399
address: redis://@{{.Address}}
400
401
- id: "rethinkdb"
402
match: '{{ and (eq .Port "28015") (eq .Comm "rethinkdb") }}'
403
config_template: |
465
- module: rethinkdb
404
name: local
405
address: {{.Address}}
406
407
- id: "riak"
408
match: '{{ and (eq .Port "8098") (glob .Cmdline "*riak*") }}'
409
config_template: |
472
- module: riakkv
410
name: local
411
url: http://{{.Address}}/stats
412
413
- id: "rspamd"
414
match: '{{ and (eq .Port "11334") (eq .Comm "rspamd") }}'
415
config_template: |
479
- module: rspamd
416
name: local
417
url: http://{{.Address}}
418
419
- id: "squid"
420
match: '{{ and (eq .Port "3128") (eq .Comm "squid") }}'
421
config_template: |
486
- module: squid
422
name: local
423
url: http://{{.Address}}
424
425
- id: "spigotmc"
426
match: '{{ and (eq .Port "25575") (glob .Cmdline "*spigot*") }}'
427
config_template: |
493
- module: spigotmc
428
name: local
429
address: {{.Address}}
430
431
- id: "supervisord"
432
match: '{{ and (eq .Port "9001") (eq .Comm "supervisord") }}'
433
config_template: |
500
- module: supervisord
434
name: local
435
url: http://{{.Address}}/RPC2
436
437
- id: "tomcat"
438
match: '{{ and (eq .Port "8080") (glob .Cmdline "*tomcat*") }}'
439
config_template: |
507
- module: tomcat
440
name: local
441
url: http://{{.Address}}
442
443
- id: "tor"
444
match: '{{ and (eq .Port "9051") (eq .Comm "tor") }}'
445
config_template: |
514
- module: tor
446
name: local
447
address: {{.Address}}
448
449
- id: "traefik"
450
match: '{{ and (eq .Port "80" "8080") (eq .Comm "traefik") }}'
451
config_template: |
521
- module: traefik
452
name: local
453
url: http://{{.Address}}/metrics
454
455
- id: "typesense"
456
match: '{{ and (eq .Port "8108") (eq .Comm "typesense-server") }}'
457
config_template: |
528
- module: typesense
458
name: local
459
url: http://{{.Address}}
460
api_key: {{ trimPrefix "--api-key=" (regexFind "--api-key=[^ ]+" .Cmdline) -}}
@@ -533,28 +462,24 @@ services:
462
- id: "unbound"
463
match: '{{ and (eq .Port "8953") (eq .Comm "unbound") }}'
464
config_template: |
536
- module: unbound
465
name: local
466
address: {{.Address}}
467
468
- id: "upsd"
469
match: '{{ or (eq .Port "3493") (eq .Comm "upsd") }}'
470
config_template: |
543
- module: upsd
471
name: local
472
address: {{.Address}}
473
474
- id: "uwsgi"
475
match: '{{ and (eq .Port "1717") (eq .Comm "uwsgi") }}'
476
config_template: |
550
- module: uwsgi
477
name: local
478
address: {{.Address}}
479
480
- id: "vernemq"
481
match: '{{ and (eq .Port "8888") (glob .Cmdline "*vernemq*") }}'
482
config_template: |
557
- module: vernemq
483
name: local
484
url: http://{{.Address}}/metrics
485
@@ -578,7 +503,6 @@ services:
503
- id: "zookeeper"
504
match: '{{ or (eq .Port "2181" "2182") (glob .Cmdline "*zookeeper*") }}'
505
config_template: |
581
- module: zookeeper
506
name: local
507
address: {{.Address}}
508
src/go/plugin/go.d/config/go.d/sd/snmp.conf
-1
@@ -62,7 +62,6 @@ services:
62
- id: "snmp"
63
match: '{{ true }}'
64
config_template: |
65
- module: snmp
65
update_every: 5
66
{{- if .SysInfo.Name }}
67
name: {{ .SysInfo.Name }}-ip-{{ .IPAddress }}