using dhcpd with mysql

Gregor Kling gregor.kling at dvz.fh-giessen.de
Thu Oct 2 15:41:52 UTC 2008


Hello Dmitry,
Dmitry Cherkasov schrieb:
> Hello Gregor!
>
> 2008/10/1 Gregor Kling <gregor.kling at dvz.fh-giessen.de 
> <mailto:gregor.kling at dvz.fh-giessen.de>>
>
>     Hello Dmitry,
>     Dmitry Cherkasov schrieb:
>
>         Hello everybody.
>
>         I am sure this topic was discussed a lot of times, yet I
>         didn't find
>         satisfying information in ISC DHCP docs or internet.
>
>         I'm looking for a solution to tie dhcpd with external
>         database, e.g.
>         MySQL. What I need is the following:
>
>         1) keeping per host (and probably other) information in
>         external DB so
>         that dhcpd queries it when serving requests
>         2) storing lease information in external DB
>
>         Certainly, some tasks may be fulfilled with OMAPI and parsing
>         dhcpd.leases, but it does not seem to be flexible enough.
>         So the question is how it may be possible to implement dhcpd
>         interaction with external SQL database?
>
>          
>
>     It may not be very helpful to you, but it does not feel very
>     comfortable with life-asking a backend database
>     for something ~trivial~ as dhcp/dns data.
>     This is another layer that could wreak havoc. In case of problems
>     you have to cope not with flat files but with a system that need
>     to use a query language instead of a simple grep.
>     If you want to host your data in a database there a plenty good
>     reasons.
>     But IMHO its always better to generate the data for dns or dhcp
>     data from the backend and use the native format of
>     the service.
>     Why do you want to hold data about leases in a mysql databases. I
>     cannot see an advantage ?
>
>
>
> This is not a problem in general to _provide_ configuration data for 
> dhcpd operation. One can use omapi or generate conf file and then 
> sighup the daemon.
> The problem is to _get_ data from dhcpd. Accounting is one of such 
> examples. Integration with sophisticated management and monitoring 
> systems is another one. Parsing dhcpd.leases may serve as a certain 
> solution but it is far from convenient interfacing with other 
> applications.
> Several dhcpd's working with a common lease db may also be an 
> interesting application. This is practically impossible with linear 
> text file.
>
> As an intermediate solution there may be a possibility to execute some 
> external programs/scripts on significant actions of dhcpd (choosing 
> client data to deliver, installing or removing a lease, etc.) but this 
> may have a significant impact on performance, I suppose.
>  
> As you see there is another post confirming the need for the feature, 
> also I wrote in my first letter:
>
Hm, Accounting came first to my mind as i wrote the mail.
The modality how dhcpd preserves its lease data is really a little 
annoying for administration purposes.
This is something I have on my agenda - a script interpreting the leases 
file.
In the absent of an existing convenient solution, I only can imagine
to write a script-suit parsing syslog and the leases file and use nagios 
nrpe somehow.
But this is the beginning of your question - I think ;-)

 
>  
>
>
>         P.S. I'm obviously not the first to look for such solution,
>         there are
>         for example http://users.accesscomm.ca/docsis_server/ ,
>         http://www.anemon.org/wiki/ .
>         Also there are DHCP implementations when server generates
>         accounting
>         using some AAA protocol like RADIUS (e.g.
>         http://www.cisco.com/en/US/docs/ios/12_2sr/12_2srb/feature/guide/ipradacc.html).
>
>          
>
>
>
> -- 
> Dmitry Cherkasov



More information about the dhcp-users mailing list