<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Shankha,<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I recently took a swing at doing the same using the dhcpdtl APIs. I found the API to be extremely cumbersome (maybe just me). I ended up back at parsing the dhcpd.leases file (ugh). I ended up writing a PHP class that takes in the leases file and parses it, outputting a associative array with everything I needed from it.  It depends on Carbon for dealing with timestamps. It's fairly basic, but you're welcome to take a look at it.  <a href="http://pastebin.com/GD2i4i6s">http://pastebin.com/GD2i4i6s</a><br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">You can disregard the GuzzleHttp usage in there. A previous iteration of this "solution" (I used that lightly) was to use the old dhcpd-pools script on the dhcp server and offer up it's output (json) to my web application. So guzzle was just running over to get that output from the dhcp server.  It isn't necessarily needed in this class.<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Good luck.<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">-goat<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 9:28 AM, shankha <span dir="ltr"><<a href="mailto:shankhabanerjee@gmail.com" target="_blank">shankhabanerjee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I was trying to program DHCP leases and going through the dhcpctl API's<br>
<br>
Is there a way I can get a list of all the leases (or the IP address)<br>
from the dhcp server.<br>
I do not know the IP address before hand.<br>
<br>
Thanks<br>
_______________________________________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-users</a><br>
</blockquote></div><br></div>