[stork-users] Issues with stork-agent
David Rickard
david.rickard at bnu.ac.uk
Fri May 31 15:33:13 UTC 2024
Hello,
I was initially going to open an issue on gitlab, but it said have you asked here, so I thought I would. As I already started filling in the issue template, I've included that here below.
**Describe the bug** stork-agent is configured and operational on a running kea-dhcp server. The agent is repeatedly polling the kea-ctrl service with config-get, but fails with an error: level="warning" msg="Skipped refreshing viewable log files because config-get returned unsuccessful result". If I manually issue a config-get to kea-ctrl (via the socket) I received a full config, with loggers. Upon further inspection of the source, I see these lines in agent/kea.go:
`if response.Result > 0 { log.Warn("Skipped refreshing viewable log files because config-get returned unsuccessful result") return nil }`
This suggests (to me) that if the result is greater than zero (which it is) that it throws an error. Is this right? This is certainly what seems to be happening. The kea-ctrl logs show it happily responding to the config-get responses.
**To Reproduce** Steps to reproduce the behavior:
* Server is RHEL 8. Installed kea 2.4.1, stork-agent is version 1.16.0 from Cloudsmith repos, and registered to a remote stork server.
* Built second server as HA hot failover.
* kea is configured thus (subnets have been omitted for clarity):
{
"Dhcp4": {
"interfaces-config": {
"interfaces": [ "*" ],
"dhcp-socket-type": "udp"
},
"control-socket": {
"socket-type": "unix",
"socket-name": "/tmp/kea4-ctrl-socket"
},
"multi-threading": {
"enable-multi-threading": true,
"thread-pool-size": 12,
"packet-queue-size": 792
},
"hooks-libraries": [{
"library": "/usr/lib64/kea/hooks/libdhcp_lease_cmds.so",
"parameters": { }
}, {
"library": "/usr/lib64/kea/hooks/libdhcp_ha.so",
"parameters": {
"high-availability": [{
"this-server-name": "NODE1",
"mode": "hot-standby",
"heartbeat-delay": 10000,
"max-response-delay": 60000,
"max-ack-delay": 5000,
"max-unacked-clients": 1,
"send-lease-updates": false,
"sync-leases": false,
"peers": [{
"name": "NODE1",
"url": "http://NODE1_IP:8001/",
"role": "primary"
}, {
"name": "NODE2",
"url": "http://NODE2_IP:8001/",
"role": "standby"
}]
}]
}
}],
"lease-database": {
"type": "mysql",
"name": "kea_dhcp",
"user": "kea_dhcp",
"password": "somepassword",
"host": "localhost",
"port": 3306,
"lfc-interval": 3600
},
"hosts-database": {
"type": "mysql",
"name": "kea_dhcp",
"user": "kea_dhcp",
"password": "somepassword",
"host": "localhost",
"port": 3306
},
"expired-leases-processing": {
"reclaim-timer-wait-time": 10,
"flush-reclaimed-timer-wait-time": 25,
"hold-reclaimed-time": 3600,
"max-reclaim-leases": 100,
"max-reclaim-time": 250,
"unwarned-reclaim-cycles": 5
},
"renew-timer": 900,
"rebind-timer": 1800,
"valid-lifetime": 3600,
"option-data": [
{
"name": "domain-name-servers",
"data": "NODE1_IP, NODE2_IP"
},
{
"code": 15,
"data": "mydomain"
}
],
// Subnet4
"loggers": [
{
"name": "kea-dhcp4",
"severity": "INFO",
"output_options": [
{
"output": "/var/log/kea/dhcp4.log"
}
]
},
{
"name": "kea-dhcp4.dhcpsrv",
"severity": "INFO",
"output_options": [
{
"output": "/var/log/kea/dhcp4-dhcpsrv.log"
}
]
},
{
"name": "kea-dhcp4.leases",
"severity": "INFO",
"output_options": [
{
"output": "/var/log/kea/dhcp4-leases.log"
}
]
}
]
}
}
* stork-agent is configured thus:
### the IP or hostname to listen on for incoming Stork server connections
STORK_AGENT_HOST=[STORK SERVER IP]
### the TCP port to listen on for incoming Stork server connections
STORK_AGENT_PORT=8082
### listen for commands from the Stork server only, but not for Prometheus requests
STORK_AGENT_LISTEN_STORK_ONLY=true
**Expected behavior** Stork-agent should be able to read the config, and then read the log files to get live information on leases, etc.
**Environment:**
- Kea version: 2.4.1, from Cloudsmith repo.
- Stork: 1.16.0, from Cloudsmith repo.
- OS: RHEL 8.9
- Kea: RPM release, so default.
- Kea: lease_cmds, ha
**Additional Information** Stork is reporting the full configuration, and all the subnets of the attached agent. But it shows no utilisation in the subnet I am testing with - I only have a single client using the Kea servers right now. Searching the DHCP Leases in Stork shows the client, but that's the only place. When I checked the logs on the server the agent is trying repeatedly (many times per minute) to get-config against Kea, with no success. But it must be having some success as Stork does report so much information.
I have looked over the configs repeatedly and unless I've missed something obvious, I'm at a bit of a loss.
I'm also hopeful resolving this will stop the log spam!
Thanks in advance.
David Rickard
Head of Technology
DTS Directorate
Buckinghamshire New University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/stork-users/attachments/20240531/b9e1343b/attachment-0001.htm>
More information about the Stork-users
mailing list