varalaxmibbnl has asked for the wisdom of the Perl Monks concerning the following question:
hi monks...
i have dhcp server which gives ip to few systems..using mac address how wil i find the ip address of that system from dhcpd.leases file via perl...
#dhcp.pl #!/usr/bin/perl #use strict; use Net::SSH::Perl; $hostname = "dhcp-server"; $username = "admin"; $password = "pswd"; $ssh = Net::SSH::Perl-> new ("$hostname", debug => 0); $ssh -> login ("$username","$password"); #$ssh -> cmd ("cd /var/lib/dhcp/"); @ar = $ssh -> cmd ("cd /var/lib/dhcp/ && cat dhcpd.leases |grep $ARGV[ +0]"); print "@ar";
when i run this script as
perl dhcp.pl 12:34:56:78:90:32i'm not getting the ip...is their any module which prints ip address assigned to particular mac address..please help me thank you
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: grep ip address from dhcpd.leases file using mac address
by mmenza (Initiate) on Jan 11, 2014 at 11:47 UTC | |
Re: grep ip address from dhcpd.leases file using mac address
by Laurent_R (Canon) on Jan 11, 2014 at 13:57 UTC |
Back to
Seekers of Perl Wisdom