I think, with this code it would be nice :
 
@lines= $telnet->cmd("Networking\/ IP \% IPMAC");
print STDOUT @lines;
$telnet->close;
 
Also, I have noticed that you have not the "Prompt" parameter in your new
method ... coudl be required...
 
Yves

-----Original Message-----
From: Attiah, Ibrahim A [mailto:ibrahim.attiah@;aramco.com]
Sent: Saturday, November 09, 2002 8:22 AM
To: [EMAIL PROTECTED]
Subject: Telnet and IPMAC
Importance: High



One of the activities that I periodically need to do is accessing about 12
network switches and list the active IP address, MAC address and the port
number (which each workstation is connected to in the switch).

 

I used to do this from CMD as follow:

>TelNet "switch Name or IP address"

Enter the Login ID + password

Then through the following commands I got what I want  

Networking/ IP % IPMAC

 

IP Address         MAC Address     Slot / Int

xx.xxx. 13.  2     00065B:A7B250     5 / 20

xx. xxx. 13.  9     00C04F:56A16D     4 / 21

xx. xxx. 13. 10     00C04F:4E2557     4 / 8

xx. xxx. 13. 12     00065B:A8405F     4 / 24

xx. xxx. 13.116     00C04F:24D92D     5 / 16

 

To automate the previous process, I am implementing the following PERL code
which work fine. 

use Net::Telnet;

  $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die');

  $telnet->open('switch Name or IP address');

  $telnet->login('Login Id', 'Password');

  

How can I complete this code to get the same required data?

 

Thank you.  

 

 

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to