DHCP Scripts needed!

May 28, 2004 Posted by mitch | projects, work | 0 Comments

Ok,

I don't get it... is dhcp the red headed step child of all IT services? I mean the lack of managment tools for it is rediculous. After reading tons of docs, and the DHCP Handbook(2nd edt.) and even more forum postings... it seems that its annoying enough that it would be nice to get it fixed... but no one seems to have any kind of solution. A little more about what I'm refering too... I would like a script that parses through the dhcpd.leases file and either out puts totals of various lease information based on criteria I specify. OR does a straight dump to a database, and then can be queried in anyway needed. I would think this isn't an uncommon request, just no one has done anything about it, because it will be a HUGE pain.

Honestly... I don't think it would be THAT hard to accomplish this. However, I understand that the dhcpd.leases file isn't kept in the best format for such a thing.

Anyway, this is what I'm thinking. Two scripts, First(1) would be an initialization script of such. Basically it would be to initialize the database and update IP's. Anytime the you added a pool or changed a range of IP's, this script would to be run. Its purpose would be to look at all the ranges in the dhcpd.conf file, and create the rows in a table for EACH ip in those ranges(creating a defacto list of ALL ips the DHCP server is going to be serving). Then the Second(2) script would be cron'd to run every 5 min or however often you wanted it to run. It would then parse through the dhcpd.leases file, and for every IP, it would update that lease information into that IP's row in the database(that is why the IP would be the defacto... as there should only be one listing of it). I am uncertain at this moment, if an IP will be listed more than once in the dhcpd.leases file. As I don't know if the DHCP server always creates a new entry everytime it does something with a particular lease, and how often it removes them if that is the case. (hope that makes sence... for me in the future...), anyway, if all it has to do is do a update on that IP's row in the DB, creating a web app to parse through that information is trivial.

Anyway... just another project I've come up with that would make my job easier...


Comments

Post a comment

Random Quote:

I do not envy people who think they have a complete explanation of the world, for the simple reason that they are obviously wrong

- Salman Rushdie