Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
4  
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
add comment

1 Answer

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 = "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

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

Your Answer

 
discard

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.