logging the lease time *sent* to clients in an "on commit" block
Glenn Satchell
Glenn.Satchell at uniq.com.au
Mon May 21 13:24:46 UTC 2007
>Date: Mon, 21 May 2007 13:50:31 +0100
>From: Phil Mayers <p.mayers at imperial.ac.uk>
>To: dhcp-users at isc.org
>CC: "Niall O'Reilly" <Niall.oReilly at ucd.ie>
>Subject: Re: logging the lease time *sent* to clients in an "on commit" block
>X-archive-position: 3664
>X-ecartis-version: Ecartis v1.0.0
>X-original-sender: p.mayers at imperial.ac.uk
>List-software: Ecartis version 1.0.0
>X-List-ID: <dhcp-users.isc.org>
>X-list: dhcp-users
>
>Niall O'Reilly wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>> On 18 May 2007, at 16:44, Phil Mayers wrote:
>>
>>> What syntax can I use to get the ACTUAL IP address lease time (option
>>> 51) the server sends to the client? We have a need to do detailed
>>> logging of leases handed out including the lease time.
>>
>> Why use an "on commit" action to duplicate what dhcpd is already
>> writing to the leases file?
>>
>> Parsing the leases file "offline" at regular intervals can't be
>> much more difficult than doing the same with your logs, and avoids
>> extra processing during allocation or renewal of each lease.
>
>Well, thanks for the suggestion but that's not really what I'm looking
>for, for two reasons:
>
> 1. the leases file doesn't list fixed addresses
> 2. I'm looking for <20 seconds turnaround time between the lease
>granted and it making it into the logging system.
>
>There are loads of ways to work around this; since I'm generating the
>DHCP configs and our config is simple enough that lease times are
>dependent on IP address only, I could dump a mapping of IP -> leasetime
>at config generation time; but it seems silly that the "on commit" has
>access to all the info except that.
>
>Does anyone know if it's possible or not?
I haven't actually tested it, but option dhcp-lease-time looks like the
right thing. You may also need to check option dhcp-message-type to
make sure you are recording it for the right type of packet as this can
also be set on DHCPREQUEST. Details on possible values in dhcp-options
man page.
regards,
-glenn
More information about the dhcp-users
mailing list