0

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.

1 Answer 1

1

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.

Or.....

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.

1
  • 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, 2010 at 10:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .