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.
-
4This 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– Shawn J. Goff2010-12-10 14:44:54 +00:00Commented Dec 10, 2010 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– BrNathan2010-12-10 21:01:55 +00:00Commented Dec 10, 2010 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– tshepang2011-02-04 18:39:21 +00:00Commented Feb 4, 2011 at 18:39
Add a comment
|
1 Answer
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 = "1.3.6.1.4.1.311.1.3.2.1.1.1";
$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
-
Awesome. I just saw your answer. Thanks for the help.BrNathan– BrNathan2012-02-18 00:02:26 +00:00Commented Feb 18, 2012 at 0:02