I too would love to do LEASEQUERY from PHP. I have tried and been unsuccessful as well. I've worked a bit with the following code but have not had time to do any testing with it since it was updated. You might give it a test and see if you can get further with it? check out the leasequery.php file in the repository.<div>
<br></div><div><a href="http://github.com/adinardi/phpdhcp">http://github.com/adinardi/phpdhcp</a></div><div><br></div><div>I also have tried to use the PERL leasequery tool and had trouble getting it to work.</div><div>
<br>
</div><div>My goal with leasequery is to simply create a function that I can give a single IP or a range of IPs (masked or range) and get a list of lease information from the DHCP server. I'd prefer not to have to look at leasefiles but to use the LEASEQUERY method to ask the server directly.</div>
<div><br></div><div>Thanks</div><div><br><div class="gmail_quote">On Thu, May 20, 2010 at 8:53 AM, Pat Winn <span dir="ltr"><<a href="mailto:ptwinn@cimtel.net">ptwinn@cimtel.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Greetings,<br>
I am trying to construct a LEASEQUERY packet in PHP that<br>
I can use to query our ISC DHCP daemon with.<br>
<br>
I have gotten as far as seeing the packet show up in a<br>
WireShark packet trace and it looks correct there (I think?).<br>
I never see anything show up in our syslog or on stderr if<br>
ran in debug however.<br>
<br>
If I attach to the running daemon with strace (Linux/Fedora),<br>
I can see about four lines come up when the packet arrives,<br>
acknowledging that it received a packet, but it doesn't do<br>
anything with it, just throws it out or so I'm assuming.<br>
I am using packet type 10, not 13 as stated in RFC 4338 and<br>
RFC 2131.<br>
<br>
I can try sending a lease query using a Perl script which is<br>
said to work w/ ISC's DHCPd but even with that I see the same<br>
things take place in my packet trace/syslog/strace/etc.<br>
<br>
No matter how I go about it, it's still no joy.<br>
<br>
I have tried version 3.x and am now on a freshly compiled<br>
version 4.1.1 with pretty much everything enabled.<br>
<br>
I do have allow leasequery in my dhcpd.conf.<br>
<br>
What else might I be missing or doing wrong?<br>
I know I am close.<br>
<br>
Also, is there anything like this already written that I'm not<br>
finding that might save me from re-inventing the wheel??<br>
<br>
Thanks in advance for any help offered!<br>
<br>
--<br>
Patrick T. Winn<br>
Systems Engineer<br>
Cimarron Telephone Co.<br>
(918) 865-3311 x280 - office<br>
(918) 606-6602 - cell<br>
<br>
<br>
<br>
_______________________________________________<br>
dhcp-hackers mailing list<br>
<a href="mailto:dhcp-hackers@lists.isc.org">dhcp-hackers@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-hackers" target="_blank">https://lists.isc.org/mailman/listinfo/dhcp-hackers</a><br>
</blockquote></div><br></div>