[Kea-users] Current leases

Tomek Mrugalski tomasz at isc.org
Thu Mar 22 09:58:49 UTC 2018


On 22/03/2018 01:11, Tim Howe wrote:
> I'm troubleshooting some lease time problems, and I realize I have no
> idea how to tell what the current leases are.
> 
> Do I have to parse the kea-leases6.csv file and compare with system
> unix time?  Or is there some other mechanism provided that I haven't
> been able to find?
I presume you're using memfile as a backend and you want to inspect IPv6
leases? Lease file can be inspected, but it's essentially a journal, so
there usually are many entries for the same lease, one for every time
something happened with it (renewed, released, expired etc.). You could
reverse parse it (use the last line that mentions specific address).

Another way you may consider would be to start using a database. Then
you could inspect the database directly.

Regardless of the backend you're using, Kea 1.3.0 provides a set of REST
commands to do this in a convenient way. See User's Guide section
14.3.5: http://kea.isc.org/docs/kea-guide.html#lease-cmds
Remember to load the lease_cmds hook.

Upcoming kea 1.4 will have those commands expanded a bit. In particular,
there will be a command to retrieve all leases from a subnet. We have
the code already written for v4. See lease4-get-all in the user's guide
for upcoming 1.4.0:
https://jenkins.isc.org/job/Kea_doc/guide/kea-guide.html#lease-cmds

I'm afraid this functionality is not yet developed for v6. It will be in
the coming weeks.

Hope that helps.
Tomek



More information about the Kea-users mailing list