Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
up vote 1 down vote accepted

There isn't really a nice non windows API for you to hit via PERL, if you ran PERL on a windows box you could do it in the same script via WMI. However...

Obviously I'm not sure on your requirements, but you can (through the scheduled task or a powershell script) have a script kick off when a DHCP lease occurs... See this question for firing a script during a lease event:

How to run script on interface state change in Windows?

Then you could have a powershell script launch and dump its DHCP address (use WMI) information over to your ubuntu box (ftp/sftp) and process away. You'd always have the latest info.


Have one powershell script that runs on your windows 7/server every 20 minutes and probes (via WMI) your workstations and dumps to your central ubuntu box. You lose out on laptops that might be moving around though. Basically WMI is your friend, you can get that info locally or remotely, but it requires windows.

share|improve this answer
Thanks for the reply. Well, it perl doesn't have any way to use WMI, then I guess I have to put something on the server. – BrNathan Dec 11 '10 at 10:13

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.