I need to parse dhcpd.leases to store data in mysql

Glenn Satchell Glenn.Satchell at uniq.com.au
Fri Jun 30 14:09:02 UTC 2006

The lease file is private data for dhcpd, so customising the lease file
format means that dhcpd has to be able to read it back in at startup
time. That seems like it would be easy to make dhcpd get corrupted data
doing that.

dhcpd is single threaded, so any extra latency introduced by writing to
a database restricts how rapidly it can respond to dhcp requests, which
is the main goal.

A possibility would be a customised logging feature though. This could
write to a file or perhaps a named pipe and you have a script listening
on the other side of the pipe to write to a database, or whatever
output you wanted.


>Subject: RE: I need to parse  dhcpd.leases to store data in mysql
>Date: Fri, 30 Jun 2006 15:23:01 +0200
>From: "Her, Andre" <andre.her at eds.com>
>If we are talking about modifying the source code, why not an option to
>either give a customized format to the lease file or an option to load
>directly into a database ? 
>-----Original Message-----
>From: dhcp-users-bounce at isc.org [mailto:dhcp-users-bounce at isc.org] On
>Behalf Of Simon Hobson
>Sent: vrijdag 30 juni 2006 15:15
>To: dhcp-users at isc.org
>Subject: Re: I need to parse dhcpd.leases to store data in mysql
>Brent L. Bates wrote:
>>      Could the syslog output be of any help for the person trying to 
>>log everything to his MySQL data base?  He could have all this output 
>>sent to its own log file.  I know the default output doesn't have all 
>>the information he needs.  However, are there any `ifdefs' that might 
>>turn this information on and log it?  If not, how difficult would it be
>to modify the source to do so?
>>  Just some ideas.
>A good point. Another option would be to use the "on <action> ..." 
>external links, eg "on commit <call code to add record to database>". 
>Though care needs to be taken when using these not to introduce too much
>latency into the server.

More information about the dhcp-users mailing list