Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fccca5f
unbound module wip
ilyam8 Nov 14, 2019
e7065af
add testdata
ilyam8 Nov 14, 2019
ef90ad9
collect wip
ilyam8 Nov 14, 2019
2db7721
collect wip
ilyam8 Nov 14, 2019
222c564
collect wip
ilyam8 Nov 16, 2019
30d0bdc
collect wip
ilyam8 Nov 16, 2019
ff33329
collect wip
ilyam8 Nov 16, 2019
7aa5769
collect wip
ilyam8 Nov 16, 2019
4e71e42
move init stuff to init.go
ilyam8 Nov 16, 2019
8d74309
init minor
ilyam8 Nov 16, 2019
353df42
request list avg util, recur time avg/median calc fix in cumulative mode
ilyam8 Nov 17, 2019
1672a8d
charts wip
ilyam8 Nov 17, 2019
990ac7e
use only cacheMiss for mul calc
ilyam8 Nov 18, 2019
8105c66
charts wip
ilyam8 Nov 18, 2019
60d256a
collect wip
ilyam8 Nov 18, 2019
0d8a5b3
add some comments to charts
ilyam8 Nov 18, 2019
8263bb7
some comments and config reading debug
ilyam8 Nov 18, 2019
84f6ca6
init fixes
ilyam8 Nov 18, 2019
ca0133b
collect tests
ilyam8 Nov 18, 2019
6a28cf0
collect tests
ilyam8 Nov 18, 2019
6aa2e12
tests
ilyam8 Nov 18, 2019
9ff117a
comment out Test_clientFetch
ilyam8 Nov 18, 2019
433db71
revert comment out Test_clientFetch
ilyam8 Nov 18, 2019
f50acf9
test charts
ilyam8 Nov 19, 2019
eb3e127
disable_tls => use_tls
ilyam8 Nov 19, 2019
0ba23ea
use_tls fix
ilyam8 Nov 19, 2019
6a3f053
fix unbound config
ilyam8 Nov 19, 2019
e852190
fix unbound config
ilyam8 Nov 19, 2019
359066a
readme wip
ilyam8 Nov 19, 2019
ae4c804
readme wip
ilyam8 Nov 19, 2019
51b793e
readme wip
ilyam8 Nov 19, 2019
12d4318
tune charts
ilyam8 Nov 19, 2019
2545e76
tune charts
ilyam8 Nov 19, 2019
c841fc9
tune charts
ilyam8 Nov 19, 2019
1d68f8e
readme update
ilyam8 Nov 19, 2019
f3979ce
disable by default for now
ilyam8 Nov 19, 2019
97c0937
charts prio const names change
ilyam8 Nov 19, 2019
f5445fa
readme suggested changes
ilyam8 Nov 19, 2019
ea44585
enable by default
ilyam8 Nov 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/godplugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
_ "github.com/netdata/go.d.plugin/modules/solr"
_ "github.com/netdata/go.d.plugin/modules/springboot2"
_ "github.com/netdata/go.d.plugin/modules/tengine"
_ "github.com/netdata/go.d.plugin/modules/unbound"
_ "github.com/netdata/go.d.plugin/modules/vcsa"
_ "github.com/netdata/go.d.plugin/modules/vsphere"
_ "github.com/netdata/go.d.plugin/modules/weblog"
Expand Down
136 changes: 136 additions & 0 deletions config/go.d/unbound.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# netdata go.d.plugin configuration for unbound
#
# This file is in YaML format. Generally the format is:
#
# name: value
#
# There are 2 sections:
# - GLOBAL
# - JOBS
#
#
# [ GLOBAL ]
# These variables set the defaults for all JOBs, however each JOB may define its own, overriding the defaults.
#
# The GLOBAL section format:
# param1: value1
# param2: value2
#
# Currently supported global parameters:
# - update_every
# Data collection frequency in seconds. Default: 1.
#
# - autodetection_retry
# Re-check interval in seconds. Attempts to start the job are made once every interval.
# Zero means not to schedule re-check. Default: 0.
#
# - priority
# Priority is the relative priority of the charts as rendered on the web page,
# lower numbers make the charts appear before the ones with higher numbers. Default: 70000.
#
#
# [ JOBS ]
# JOBS allow you to collect values from multiple sources.
# Each source will have its own set of charts.
#
# IMPORTANT:
# - Parameter 'name' is mandatory.
# - Jobs with the same name are mutually exclusive. Only one of them will be allowed running at any time.
#
# This allows autodetection to try several alternatives and pick the one that works.
# Any number of jobs is supported.
#
# The JOBS section format:
#
# jobs:
# - name: job1
# param1: value1
# param2: value2
#
# - name: job2
# param1: value1
# param2: value2
#
# - name: job2
# param1: value1
#
#
# [ List of JOB specific parameters ]:
# - address
# Server address.
# Syntax:
# address: 127.0.0.1:8953
# address: /var/run/unbound.sock
#
# - timeout
# Connection/read/write/ssl handshake timeout.
# Syntax:
# timeout: 1
#
# - conf_path
# Absolute path to the unbound configuration file. Module uses the file to autodetect 'address', 'cumulative',
# 'use_tls', 'tls_cert' and 'tls_key' parameters.
# To disable parameters auto detection set it to empty string ("").
# Syntax:
# conf_path: /path/to/unbound.conf
#
# - cumulative
# Statistics collection mode. Should have the same value as the `statistics-cumulative` parameter in the unbound
# configuration file.
# Syntax:
# cumulative: yes/no
#
# - use_tls
# Whether to use or not TLS.
# Syntax:
# use_tls: yes/no
#
# - tls_skip_verify
# Whether to skip verifying server's certificate chain and hostname.
# Syntax:
# tls_skip_verify: yes/no
#
# - tls_cert
# Client tls certificate.
# Syntax:
# tls_cert: path/to/cert.pem
#
# - tls_key
# Client tls key.
# Syntax:
# tls_key: path/to/key.pem
#
#
# [ JOB defaults ]:
# address: 127.0.0.1:8953
# timeout: 1
# conf_path: /etc/unbound/unbound.conf
# cumulative: no
# use_tls: yes
# tls_skip_verify: yes
# tls_cert: /etc/unbound/unbound_control.pem
# tls_key: /etc/unbound/unbound_control.key
#
#
# [ JOB mandatory parameters ]:
# - name
# - address
#
# ------------------------------------------------MODULE-CONFIGURATION--------------------------------------------------
# [ GLOBAL ]
# update_every: 1
# autodetection_retry: 0
# priority: 70000
#
#
# [ JOBS ]
jobs:
- name: local
address: 127.0.0.1:8953
timeout: 1
conf_path: /etc/unbound/unbound.conf
cumulative: no
use_tls: yes
tls_skip_verify: yes
tls_cert: /etc/unbound/unbound_control.pem
tls_key: /etc/unbound/unbound_control.key
131 changes: 131 additions & 0 deletions modules/unbound/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# unbound

This module monitors one or more [`Unbound`](https://nlnetlabs.nl/projects/unbound/about/) servers, depending on your configuration.

## Requirements

- `Unbound` with enabled `remote-control` interface (see [unbound.conf](https://nlnetlabs.nl/documentation/unbound/unbound.conf))

If using unix socket:

- socket should be readable and writeable by `netdata` user

If using ip socket and TLS is disabled:

- socket should be accessible via network

If TLS is enabled, in addition:

- `control-key-file` should be readable by `netdata` user
- `control-cert-file` should be readable by `netdata` user

For auto detection parameters from `unbound.conf`:

- `unbound.conf` should be readable by `netdata` user

## Charts

Module produces following summary charts:

- Received Queries in `queries`
- Rate Limited Queries in `queries`
- DNSCrypt Queries in `queries`
- Cache Statistics in `events`
- Cache Statistics Percentage in `events`
- Cache Prefetches in `prefetches`
- Replies Served From Expired Cache in `replies`
- Replies That Needed Recursive Processing in `replies`
- Time Spent On Recursive Processing in `milliseconds`
- Request List Usage in `queries`
- Current Request List Usage in `queries`
- Request List Jostle List Events in `queries`
- TCP Handler Buffers in `buffers`
- Uptime `seconds`

If `extended-statistics` is enabled:

- Queries By Type in `queries`
- Queries By Class in `queries`
- Queries By OpCode in `queries`
- Queries By Flag in `queries`
- Replies By RCode in `replies`
- Cache Items Count in `items`
- Cache Memory in `KB`
- Module Memory in `KB`
- TCP and TLS Stream Waif Buffer Memory in `KB`

Per thread charts (only if number of threads > 1):
Comment thread
ilyam8 marked this conversation as resolved.

- Received Queries in `queries`
- Rate Limited Queries in `queries`
- DNSCrypt Queries in `queries`
- Cache Statistics in `events`
- Cache Statistics Percentage in `events`
- Cache Prefetches in `prefetches`
- Replies Served From Expired Cache in `replies`
- Replies That Needed Recursive Processing in `replies`
- Time Spent On Recursive Processing in `milliseconds`
- Request List Usage in `queries`
- Current Request List Usage in `queries`
- Request List Jostle List Events in `queries`
- TCP Handler Buffers in `buffers`


## Configuration

This Unbound collector only needs the `address` to aserver's `remote-control` interface if TLS is disabled or `address` is unix socket.
Otherwise you need to set path to the `control-key-file` and `control-cert-file` files.

The module tries to auto-detect following parameters reading `unbound.conf`:
- address
- cumulative
- use_tls
- tls_cert
- tls_key

Module supports both cumulative and non-cumulative modes. Default is non-cumulative. If your server has enabled
`statistics-cumulative`, but the module fails to auto-detect it (`unbound.conf` is not readable or it is a remote server),
you need to set it manually in the configuration file.

Here is an example for several servers:

```yaml
jobs:
- name: local
address: 127.0.0.1:8953
use_tls: yes
tls_skip_verify: yes
tls_cert: /etc/unbound/unbound_control.pem
tls_key: /etc/unbound/unbound_control.key

- name: remote
address: 203.0.113.10:8953
use_tls: no

- name: remote_cumulative
address: 203.0.113.11:8953
use_tls: no
cumulative: yes

- name: socket
address: /var/run/unbound.sock
```

For all available options, please see the module [configuration file](https://github.com/netdata/go.d.plugin/blob/master/config/go.d/unbound.conf).


## Troubleshooting

Ensure that the control protocol is actually configured correctly.
Run following command as `root` user:
> unbound-control stats_noreset

It should print out a bunch of info about the internal statistics of the server.
If this returns an error, you don't have the control protocol set up correctly.

Check the module debug output.
Run following command as `netdata` user:

> ./go.d.plugin -d -m unbound

---
Loading