Good day!
I have an Ubuntu 20.04 server with kea-dhcp 2.4.1 version installed. Everything works fine; the server issues leases. On another ubuntu server, Stork was installed to monitor my kea-dhcp server. Stork shows the server, shows pools, reservations on the server, but does not show dhcp-leases.
kea-dhcp4.conf
{
"Dhcp4": {
"interfaces-config": {
"interfaces": ["ens192"]
},
"control-socket": {
"socket-type": "unix",
"socket-name": "/run/kea/kea4-ctrl-socket"
},
"lease-database": {
"type": "mysql",
"name": "kea_leasing",
"user": "myuser",
"password": "mypass",
"host": "localhost",
"port": 3306
},
"hosts-database": {
"type": "mysql",
"name": "kea_leasing",
"user": "myuser",
"password": "mypass",
"host": "localhost",
"port": 3306
},
"renew-timer": 15840,
"rebind-timer": 27720,
"valid-lifetime": 31680,
"option-data": [
{
"name": "domain-name-servers",
"data": "10.12.15.1, 10.12.15.2"
},
{
"name": "domain-search",
"data": "mydomain.local"
}
],
"subnet4": [
{
"subnet": "10.100.95.0/24",
"pools": [ { "pool": "10.100.95.100 - 10.100.95.150" } ],
"option-data": [
{
"name": "routers",
"data": "10.100.95.2"
}
]
// Add reservations here
}
// Add subnets here
]
}
}
kea-ctrl-agent.conf
{
// This is a basic configuration for the Kea Control Agent.
// RESTful interface to be available at http://127.0.0.1:8000/
"Control-agent": {
"http-host": "127.0.0.1",
// If enabling HA and multi-threading, the 8000 port is used by the HA
// hook library http listener. When using HA hook library with
// multi-threading to function, make sure the port used by dedicated
// listener is different (e.g. 8001) than the one used by CA. Note
// the commands should still be sent via CA. The dedicated listener
// is specifically for HA updates only.
"http-port": 8000,
// Specify location of the files to which the Control Agent
// should connect to forward commands to the DHCPv4, DHCPv6
// and D2 servers via unix domain sockets.
"control-sockets": {
"dhcp4": {
"socket-type": "unix",
"socket-name": "/run/kea/kea4-ctrl-socket"
},
"dhcp6": {
"socket-type": "unix",
"socket-name": "/tmp/kea6-ctrl-socket"
},
"d2": {
"socket-type": "unix",
"socket-name": "/tmp/kea-ddns-ctrl-socket"
}
},
// Specify hooks libraries that are attached to the Control Agent.
// Such hooks libraries should support 'control_command_receive'
// hook point. This is currently commented out because it has to
// point to the existing hooks library. Otherwise the Control
// Agent will fail to start.
"hooks-libraries": [
// {
// "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/control-agent-commands.so",
// "parameters": {
// "param1": "foo"
// }
// }
],
// Logging configuration starts here. Kea uses different loggers to log various
// activities. For details (e.g. names of loggers), see Chapter 18.
"loggers": [
{
// This specifies the logging for Control Agent daemon.
"name": "kea-ctrl-agent",
"output_options": [
{
// Specifies the output file. There are several special values
// supported:
// - stdout (prints on standard output)
// - stderr (prints on standard error)
// - syslog (logs to syslog)
// - syslog:name (logs to syslog using specified name)
// Any other value is considered a name of the file
"output": "stdout",
// Shorter log pattern suitable for use with systemd,
// avoids redundant information
"pattern": "%-5p %mn"
// This governs whether the log output is flushed to disk after
// every write.
// "flush": false,
// This specifies the maximum size of the file before it is
// rotated.
// "maxsize": 1048576,
// This specifies the maximum number of rotated files to keep.
// "maxver": 8
}
],
// This specifies the severity of log messages to keep. Supported values
// are: FATAL, ERROR, WARN, INFO, DEBUG
"severity": "INFO",
// If DEBUG level is specified, this value is used. 0 is least verbose,
// 99 is most verbose. Be cautious, Kea can generate lots and lots
// of logs if told to do so.
"debuglevel": 0
}
]
}
}
agent.env
### the IP or hostname to listen on for incoming Stork server connections
STORK_AGENT_HOST=10.100.95.37
### the TCP port to listen on for incoming Stork server connections
STORK_AGENT_PORT=8080
### listen for commands from the Stork server only, but not for Prometheus requests
#STORK_AGENT_LISTEN_STORK_ONLY=false
### listen for Prometheus requests only, but not for commands from the Stork server
#STORK_AGENT_LISTEN_PROMETHEUS_ONLY=false
### settings for exporting stats to Prometheus
### the IP or hostname on which the agent exports Kea statistics to Prometheus
# STORK_AGENT_PROMETHEUS_KEA_EXPORTER_ADDRESS=
### the port on which the agent exports Kea statistics to Prometheus
# STORK_AGENT_PROMETHEUS_KEA_EXPORTER_PORT=
### how often the agent collects stats from Kea, in seconds
# STORK_AGENT_PROMETHEUS_KEA_EXPORTER_INTERVAL=
## enable or disable collecting per-subnet stats from Kea
# STORK_AGENT_PROMETHEUS_KEA_EXPORTER_PER_SUBNET_STATS=true
### the IP or hostname on which the agent exports BIND 9 statistics to Prometheus
# STORK_AGENT_PROMETHEUS_BIND9_EXPORTER_ADDRESS=
### the port on which the agent exports BIND 9 statistics to Prometheus
# STORK_AGENT_PROMETHEUS_BIND9_EXPORTER_PORT=
### how often the agent collects stats from BIND 9, in seconds
# STORK_AGENT_PROMETHEUS_BIND9_EXPORTER_INTERVAL=
### Stork Server URL used by the agent to send REST commands to the server during agent registration
STORK_AGENT_SERVER_URL=http://10.100.95.38:8080
### skip TLS certificate verification when the Stork Agent connects
### to Kea over TLS and Kea uses self-signed certificates
STORK_AGENT_SKIP_TLS_CERT_VERIFICATION=true
### Logging parameters
### Set logging level. Supported values are: DEBUG, INFO, WARN, ERROR
#STORK_LOG_LEVEL=INFO
### disable output colorization
# CLICOLOR=false
### path to the hook directory
# STORK_AGENT_HOOK_DIRECTORY=```
I set it up according to the official documentation, there are active reservations:
mysql> select * from lease4
-> ;
+———–+—————-+——————————————+—————-+———————+———–+———-+———-+—————————–+——-+————–+——————–+———————-+———+
| address | hwaddr | client_id | valid_lifetime | expire | subnet_id | fqdn_fwd | fqdn_rev | hostname | state | user_context | relay_id | remote_id | pool_id |
+———–+—————-+——————————————+—————-+———————+———–+———-+———-+—————————–+——-+————–+——————–+———————-+———+
| 174350180 | 0x002324D47E78 | 0xFFB6220FEB00020000AB11044C09E0CD6003B3 | 31680 | 2024-05-31 19:26:29 | 1 | 0 | 0 | colibrirud | 0 | NULL | NULL | NULL | 0 |
| 174350181 | 0x0050568440ED | 0x010050568440ED | 31680 | 2024-05-31 22:21:15 | 1 | 0 | 0 | win-sakrvli5241. | 0 | NULL | NULL | NULL | 0 |
| 174350182 | 0xA8A159B70D08 | 0x01A8A159B70D08 | 31680 | 2024-05-31 21:08:45 | 1 | 0 | 0 | mypc.local | 0 | NULL | NULL | NULL | 0 |
| 174350183 | 0x00505684F502 | 0xFF9000A08200020000AB117A9B4BED25A16205 | 31680 | 2024-05-31 21:08:39 | 1 | 0 | 0 | root | 0 | NULL | NULL | NULL | 0 |
+———–+—————-+——————————————+—————-+———————+———–+———-+———-+—————————–+——-+————–+——————–+———————-+———+
4 rows in set (0.00 sec)