<div dir="ltr">Oh I see, that made it more clear, however I still didn't understand a point. At renewal time, the client takes another full lease duration right, so I would still expect to see the full duration?<div><br><div>Perhaps is there anyway that I can log the lease end time or duration at each request? I know I can get this at the leases file, however I need to log that.<br><div><br></div><div>Thanks a lot,</div><div>Alp</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 4, 2015 at 3:47 PM, Glenn Satchell <span dir="ltr"><<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alp<br>
<br>
lease-time shows the remaining time in the lease, not the total time.<br>
<br>
This is from the dhcp-eval man page:<br>
<br>
     lease-time<br>
<br>
       The duration of the current lease - that is,  the  differ-<br>
       ence  between the current time and the time that the lease<br>
       expires.<br>
<br>
regards,<br>
-glenn<br>
<span class=""><br>
On Sat, October 3, 2015 6:51 am, Denis Laventure wrote:<br>
> The client will renew the lease at half the max-lease-time. So seeing 150<br>
> sec for a 300 sec lease seems normal.<br>
><br>
> Hi,<br>
><br>
> I have an easy question I believe, I want to log DHCP lease durations<br>
> given to clients, I tried the following, however it appears most of the<br>
> time, logs are showing half of the lease duration.<br>
><br>
> log(info, concat( "IP: ", binary-to-ascii(10, 8, ".", leased-address), " ;<br>
> ", "leasetime:", binary-to-ascii(10,32,"",encode-int(lease-time,32)) ));<br>
><br>
> I have set the following lease time values for a pool:<br>
><br>
> subnet 172.16.2.0 netmask 255.255.255.0 {<br>
>   option routers 172.16.2.1;<br>
>   pool {<br>
>     failover peer "failover-partner";<br>
>     default-lease-time 300;<br>
>     min-lease-time 300;<br>
>     max-lease-time 300;<br>
>     range<br>
</span>172.16<a href="https://www.dibbssm.net/GroupFiles/Group167/Documents/Cubs/E1_Cub_Fun_In_the_Snow.pdf.2.10" rel="noreferrer" target="_blank">https://www.dibbssm.net/GroupFiles/Group167/Documents/Cubs/E1_Cub_Fun_In_the_Snow.pdf.2.10</a><br>
<span class="">172.16.2.250;<br>
>   }<br>
> }<br>
><br>
> And this configuration produces an output like this:<br>
><br>
> Oct  2 14:34:44 mercan dhcpd: IP: 172.16.2.127 ; leasetime:155<br>
> Oct  2 14:37:10 mercan dhcpd: IP: 172.16.2.127 ; leasetime:154<br>
> Oct  2 14:37:13 mercan dhcpd: IP: 172.16.2.127 ; leasetime:297<br>
> Oct  2 14:39:37 mercan dhcpd: IP: 172.16.2.127 ; leasetime:156<br>
> Oct  2 14:42:03 mercan dhcpd: IP: 172.16.2.127 ; leasetime:154<br>
> Oct  2 14:44:28 mercan dhcpd: IP: 172.16.2.127 ; leasetime:155<br>
> Oct  2 14:46:53 mercan dhcpd: IP: 172.16.2.127 ; leasetime:155<br>
> Oct  2 14:49:18 mercan dhcpd: IP: 172.16.2.127 ; leasetime:155<br>
> Oct  2 14:49:54 mercan dhcpd: IP: 172.16.2.127 ; leasetime:264<br>
> Oct  2 14:50:47 mercan dhcpd: IP: 172.16.2.127 ; leasetime:247<br>
> Oct  2 14:51:18 mercan dhcpd: IP: 172.16.2.127 ; leasetime:269<br>
><br>
> How can log the precise lease durations, would be great if anyone has any<br>
> suggestions?<br>
><br>
> Thanks in advance.<br>
> Alp<br>
><br>
</span>> _______________________________________________<br>
> dhcp-users mailing list<br>
> <a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
<br>
<br>
_______________________________________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
</blockquote></div><br></div>