logging the lease time *sent* to clients in an "on commit" block

John Hascall john at iastate.edu
Mon May 21 13:18:25 UTC 2007


> >> 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.
        ...
> Does anyone know if it's possible or not?

I gave up trying to make "on commit" work and ended up just
making a source mod to log the info I wanted into a separate
file.  Post-processing the lease file didn't work for us
either because we run a "NetReg"-like system and there were
times that dhcpd would be restarted faster than we could
post-process the lease file.

I added my code to the supersede_lease() function in
the server/mdb.c file right before:

        if (commit) {
                if (!write_lease (comp))
                        return 0;

but I don't think that will be right for you as you
want to capture fixed-address leases too.

John


More information about the dhcp-users mailing list