|
| 1 | +## Overview |
| 2 | + |
| 3 | +A plugin allowing for importing devices from the Kea DHCP API. |
| 4 | +https://www.isc.org/kea/ |
| 5 | + |
| 6 | +And specifically: |
| 7 | +https://kea.readthedocs.io/en/kea-2.6.3/api.html#lease4-get-all |
| 8 | + |
| 9 | + |
| 10 | +### Usage |
| 11 | + |
| 12 | +To enable the API, first you want to add something like this to your main kea configuration (this is for debian 13): |
| 13 | + |
| 14 | +```json |
| 15 | + "control-socket": { |
| 16 | + "socket-type": "unix", |
| 17 | + "socket-name": "/run/kea/kea4-ctrl-socket" |
| 18 | + }, |
| 19 | + |
| 20 | + "hooks-libraries": [ |
| 21 | + { |
| 22 | + "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" |
| 23 | + } |
| 24 | + ], |
| 25 | +``` |
| 26 | + |
| 27 | + |
| 28 | +And you need to install kea-ctrl-agent, with a config that looks something like this: |
| 29 | + |
| 30 | +```json |
| 31 | +{ |
| 32 | +"Control-agent": { |
| 33 | + "http-host": "127.0.0.1", |
| 34 | + "http-port": 8000, |
| 35 | + |
| 36 | + "authentication": { |
| 37 | + "type": "basic", |
| 38 | + "realm": "Kea Control Agent", |
| 39 | + "directory": "/etc/kea", |
| 40 | + "clients": [ |
| 41 | + { |
| 42 | + "user": "kea-api", |
| 43 | + "password-file": "kea-api-password" |
| 44 | + } |
| 45 | + ] |
| 46 | + }, |
| 47 | + "control-sockets": { |
| 48 | + "dhcp4": { |
| 49 | + "socket-type": "unix", |
| 50 | + "socket-name": "/run/kea/kea4-ctrl-socket" |
| 51 | + } |
| 52 | + }, |
| 53 | + "loggers": [ |
| 54 | + { |
| 55 | + "name": "kea-ctrl-agent", |
| 56 | + "output-options": [ |
| 57 | + { |
| 58 | + "output": "stdout", |
| 59 | + "pattern": "%-5p %m\n" |
| 60 | + } |
| 61 | + ], |
| 62 | + "severity": "INFO", |
| 63 | + "debuglevel": 0 |
| 64 | + } |
| 65 | + ] |
| 66 | +} |
| 67 | +} |
| 68 | +``` |
| 69 | + |
| 70 | +You will need to configure the plugin with the URL to the API, and the username and password configured above (from kea-api-password file in the example) |
| 71 | + |
| 72 | + |
| 73 | +#### Required Settings |
| 74 | + |
| 75 | +These settings are required, besides the common device scanner settings: |
| 76 | + |
| 77 | +- **Kea Control Agent URL** (`KEALSS_URL`): The full URL, including port number, to the Kea API. |
| 78 | + - Default: `http://127.0.0.1:8000` |
| 79 | + - This mirrors what you set up in the kea-ctrl-agent configuration. |
| 80 | + |
| 81 | +- **Basic Auth Username** (`KEALSS_USER`): The user to use for authenticating with the Kea API. |
| 82 | + - Default: `kea-api` |
| 83 | + - This mirrors what you set up in the kea-ctrl-agent configuration. |
| 84 | + |
| 85 | +- **Basic Auth Password** (`KEALSS_PASS`): The password to use for authenticating with the Kea API. |
| 86 | + - This mirrors what you set up in the kea-ctrl-agent configuration. |
| 87 | + - When using a password file, it should be the content of the password file. |
| 88 | + |
| 89 | + |
| 90 | +### Notes |
| 91 | + |
| 92 | +- This was tested on a basic Debian 13 install. |
| 93 | +- When you install kea-ctrl-agent, it should ask you about creating a password. |
| 94 | +- It's possible to run kea-ctrl-agent without password, but it's not recommended and at the moment we don't support that. |
| 95 | +- I may provide some minimal support, if you ask nicely :) |
| 96 | + |
| 97 | +- Version: 1.0.0 |
| 98 | +- Author: `void-spark` |
| 99 | +- Release Date: `11/05/2026` |
0 commit comments