|
|
The following page describes how to install Stork and its dependencies on Ubuntu 18.04. Since Stork is in very early stages, it currently supports Ubuntu 18.04 only. We do not want to get distracted with portability. The list will be expanded some time in the future once the project becomes a bit more mature.
|
|
|
|
|
|
# 1. Prometheus
|
|
|
|
|
|
```console
|
|
|
# sudo apt install prometheus
|
|
|
# sudo systemctl enable prometheus
|
|
|
# sudo systemctl start prometheus
|
|
|
```
|
|
|
|
|
|
The config file is located in: `/etc/prometheus/prometheus.yml`. When started, by default Prometheus listens on localhost:9090.
|
|
|
|
|
|
## Connect Prometheus to exporters
|
|
|
|
|
|
Define connection to Prometheus by editing `/etc/prometheus/prometheus.yml`:
|
|
|
|
|
|
```yaml
|
|
|
apiVersion: 1
|
|
|
|
|
|
datasources:
|
|
|
|
|
|
# This reports statistics about Prometheus (how long it took to scape data etc.)
|
|
|
# This is built into Prometheus itself.
|
|
|
- name: Prometheus
|
|
|
type: prometheus
|
|
|
access: proxy
|
|
|
url: http://localhost:9090
|
|
|
|
|
|
# Node exporter reports hardware/OS statistics for the node (the host bind & kea are run on)
|
|
|
# Requires node-exporter to run
|
|
|
- job_name: 'node'
|
|
|
static_configs:
|
|
|
- targets: ['localhost:9100']
|
|
|
|
|
|
# Gathers statistics from Kea, requires kea-exporter
|
|
|
- job_name: 'kea'
|
|
|
static_configs:
|
|
|
- targets: ['localhost:9547']
|
|
|
|
|
|
# Gathers statistics from bind9, requires bind-exporter
|
|
|
- job_name: 'bind9'
|
|
|
static_configs:
|
|
|
- targets: ['localhost:9119']
|
|
|
|
|
|
```
|
|
|
|
|
|
## Node exporter
|
|
|
|
|
|
To install Node exporter you need a go compiler version >= 1.11. Get resources:
|
|
|
|
|
|
```console
|
|
|
$ go get github.com/prometheus/node_exporter
|
|
|
```
|
|
|
|
|
|
go to node_exporter directory:
|
|
|
|
|
|
```console
|
|
|
$ cd ${GOPATH-$HOME/go}/src/github.com/prometheus/node_exporter
|
|
|
```
|
|
|
|
|
|
and build:
|
|
|
```console
|
|
|
$ make
|
|
|
```
|
|
|
To start node exporter:
|
|
|
```console
|
|
|
$ ./node_exporter
|
|
|
```
|
|
|
You should see the output like that:
|
|
|
'''
|
|
|
INFO[0000] Starting node_exporter (version=0.16.0, branch=HEAD, revision=d42bd70f4363dced6b77d8fc311ea57b63387e4f) source="node_exporter.go:82"
|
|
|
INFO[0000] Build context (go=go1.9.6, user=root@a67a9bc13a69, date=20180515-15:53:28) source="node_exporter.go:83"
|
|
|
INFO[0000] Enabled collectors: source="node_exporter.go:90"
|
|
|
INFO[0000] - boottime source="node_exporter.go:97"
|
|
|
...
|
|
|
INFO[0000] Listening on :9100 source="node_exporter.go:111"
|
|
|
'''
|
|
|
|
|
|
By default exporter exposes metrics on localhost:9100.
|
|
|
If the Node exporter is running you can verify that metrics are being exported by cURLing the /metrics endpoint:
|
|
|
|
|
|
```console
|
|
|
$ curl http://localhost:9100/metrics
|
|
|
```
|
|
|
|
|
|
To manage statistics via Prometheus you must change the Prometheus configuration file, `/etc/prometheus/prometheus.yml`, by adding these lines to scrape_configs section:
|
|
|
```
|
|
|
- job_name: 'node'
|
|
|
static_configs:
|
|
|
- targets: ['localhost:9100']
|
|
|
```
|
|
|
|
|
|
## BIND exporter
|
|
|
|
|
|
There is a BIND 9 exporter for Prometheus available publicly [here](https://github.com/digitalocean/bind_exporter). The Github page explains how to install from source:
|
|
|
|
|
|
```
|
|
|
go get github.com/digitalocean/bind_exporter
|
|
|
cd $GOPATH/src/github.com/digitalocean/bind_exporter
|
|
|
make
|
|
|
```
|
|
|
|
|
|
Note, this depends on `promotheus/promu` that requires at least Go version 1.11.
|
|
|
|
|
|
Run BIND 9. Make sure that `named` is built with libxml2 support.
|
|
|
|
|
|
```
|
|
|
named -V | grep libxml2
|
|
|
```
|
|
|
|
|
|
The `named.conf` configuration file should at least be configured to emit statistics:
|
|
|
|
|
|
```
|
|
|
statistics-channels {
|
|
|
inet 127.0.0.1 port 8053 allow { 127.0.0.1; };
|
|
|
};
|
|
|
```
|
|
|
|
|
|
After starting BIND 9, start the `bind_exporter` and it will collect statistics from the configured channel.
|
|
|
|
|
|
```
|
|
|
./bind_exporter
|
|
|
curl http://localhost:9119/metrics
|
|
|
```
|
|
|
|
|
|
### Scrape with Prometheus
|
|
|
|
|
|
Add a new scrape job configuration for BIND 9:
|
|
|
|
|
|
```
|
|
|
scrape_configs:
|
|
|
- job_name: 'bind9'
|
|
|
static_configs:
|
|
|
- targets: ['localhost:9119']
|
|
|
```
|
|
|
|
|
|
And restart Prometheus to see the BIND 9 metrics.
|
|
|
|
|
|
## Kea exporter (Ubuntu 18.04)
|
|
|
|
|
|
There is a Kea exporter for Prometheus available publicly [here](https://github.com/mweinelt/kea-exporter). The Github page explains how to install the exporter using `pip`:
|
|
|
|
|
|
```
|
|
|
$ pip install kea-exporter
|
|
|
```
|
|
|
|
|
|
The python3 is required to run the Kea exporter. The following command line enables the Kea exporter with the Kea DHCPv4 server:
|
|
|
|
|
|
```
|
|
|
sudo kea-exporter /usr/local/etc/kea/kea-dhcp4.conf
|
|
|
```
|
|
|
|
|
|
The exporter infers the (UNIX domain) control socket configuration from the Kea configuration file. It also looks into the subnets configuration to determine the identifiers of the subnets in use. The exporter by default starts the service on the local host, port 9547.
|
|
|
|
|
|
The Kea exporter was designed to gather statistics from both DHCPv4 and DHCPv6 servers. However, it assumes that the configuration for both servers is stored in the same file. This is no longer possible in the latest Kea versions. Therefore, it is only possible to run the Kea exported for one Kea server type.
|
|
|
|
|
|
The Kea exporter for the second server can be run using different port number, e.g.:
|
|
|
|
|
|
```
|
|
|
sudo kea-exporter --port 19547 /usr/local/etc/kea/kea-dhcp6.conf
|
|
|
```
|
|
|
|
|
|
# 2. Grafana
|
|
|
|
|
|
## Installation from deb packages
|
|
|
|
|
|
```console
|
|
|
# apt-get install -y software-properties-common
|
|
|
# wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
|
|
|
# add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
|
|
|
# apt-get update
|
|
|
# apt-get install grafana
|
|
|
```
|
|
|
To start the server: `systemctl start grafana-server`. If you want grafana to start automatically after system restart, also do `systemctl enable grafana-server`. The config is in `/etc/grafana/grafana.ini`. By default, grafana listens on localhost:3000.
|
|
|
|
|
|
## Use Prometheus as datasource in Grafana
|
|
|
|
|
|
Description TODO
|
|
|
|
|
|
## Add Stork dashboard
|
|
|
|
|
|
Description TODO
|
|
|
|
|
|
It should looks more or less like this:
|
|
|
- GUI: Go to http://stork.lab.isc.org:3000/dashboard/import
|
|
|
- get stork.json from git
|
|
|
|
|
|
Alternatively, we should be able to install the dashboard using CLI (copy the file somewhere?)
|
|
|
|
|
|
# 3. Final set-up checks
|
|
|
|
|
|
You should have your environment ready. Here's a list of checks you can do to ensure your environment is sane:
|
|
|
|
|
|
1. Make sure your bind9 instance is running: `ps aux | grep named`. If not, start it with `tbd'
|
|
|
2. Make sure your Kea instance is running: `ps aux | grep kea-dhcp4` and `ps aux | grep kea-dhcp6`.
|
|
|
3. Make sure your prometheus is running. Go to http://stork.lab.isc.org:9090/targets and make sure you see bind9, kea and node on the list and all of them are marked as up.
|
|
|
4. Make sure your Grafana is running. Go to http://stork.lab.isc.org:3000, click home, click on Kea dashboard, or BIND9 dashboard.
|
|
|
|
|
|
You should see some statistics, but many of them will be zeros. That's because there isn't any traffic generated yet. If you want to see some lively action, head to [page about generating some data](Test-traffic). |
|
|
\ No newline at end of file |