Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Windows 2003 server and need to poll the DHCP lease information from it with a perl script that is running on a Ubuntu server. Then I need to analyze & store the information in a mysql database. Is there a way to query the leases from a perl script? I can figure out how to process the info after I get it. Thanks.

share|improve this question
This question is probably better on ServerFault since the question is mostly about how to extract the lease information from Windows. It has much less to do with the fact that you want to do it in Perl on a Linux box. In fact, I'd bet you need at least some code on the Windows box to do the extracting. – Shawn J. Goff Dec 10 '10 at 14:44
So you think there is no program or script to do this from Linux? Adding software on the Windows box is possible, but I really don't want to. – BrNathan Dec 10 '10 at 21:01
He didn't mean there isn't. He actually doesn't know. His point is that your more likely to get a better answer on serverfault.com. – Tshepang Feb 4 '11 at 18:39
up vote 2 down vote accepted

You can perhaps use SNMP, provided SNMP is enabled/allowed for DHCP service on Windows server. Using SNMP queries, one can build a statistics of the lease information from time to time remotely from the DHCP service.

$snmp_address = "";
$getsubnet = "snmpgetnext -v2c -c public -Oqv win_dhcp_server_ip  $snmp_address |";

better description is at https://lists.isc.org/pipermail/bind-users/2004-November/054007.html

share|improve this answer
Awesome. I just saw your answer. Thanks for the help. – BrNathan Feb 18 '12 at 0:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.