logging lease expiration time

tom tom at calixo.net
Thu Sep 26 09:38:08 UTC 2013


I would like to log() when a lease will expire/renew or just what is the 
default-lease-time or max-lease-time so a third party software knows 
when the lease will expire for a particular IP. The software won't run 
on the same box and I would like to avoid parsing dhcpd.leases.

I tried different log() combinations but it does not look like I can do 
it so I am wondering if it possible ?

  log (info, concat(IP=", binary-to-ascii (10, 8, ".", leased-address),
                    " max-lease-time=", $SOMETHING_HERE));

I tried with $SOMETHING_HERE equals to
  - max-lease-time
  - default-lease-time
  - option max-lease-time
  - option default-lease-time
  - option dhcp-lease-time

Obviously I can do the following but having to not duplicate values 
would be less error-prone:

  log (info, concat(IP=", binary-to-ascii (10, 8, ".", leased-address),
                    " max-lease-time=3600");

PS: It's really unclear what log() can read. It looks like it's only 
able to read values/options from a DHCP packet. I understand that it's 
probably uncommon to log config values though...

Any thoughts ?


More information about the dhcp-users mailing list