Hello Friends,

I have to run a command on my unix box through a script running on my
windows m/c.

Here's my code which is nothing but the example in perldoc of the module :

use Net::Telnet ();
$username = "myusername";
$passwd = "mypasswd";

$t = new Net::Telnet (Timeout => 10, Prompt => '/login \(dell001rs\): $/');

$t->open('my_machine_ip');

$t->login($username, $passwd);
@lines = $t->cmd("who");
print @lines;

Now, as per the module documentation , specifying the Prompt is very
essential if it is not like the default '/[\$%#>] $/ '
It searches through the input stream for the prompt and performs actions
accordingly.
If it is not able to find the prompt in the stream, it shall time-out
looking for the login prompt.

When I login to my machine , the login prompt is like :

login (dell001rs): 

And after logging in the prompt becomes :

[EMAIL PROTECTED] $

What should I add after "Prompt => " while creating a new session ?

No matter what I try it always aborts with the msg : "timed-out waiting for
login prompt at J:\net.pl line 10" :((

Thanx a lot
Aman









-----Original Message-----
From: Thind, Aman [mailto:[EMAIL PROTECTED] 
Sent: 05 February 2004 10:55
To: [EMAIL PROTECTED]
Subject: Remote script execution


Hello Friends,

I would be really grateful if someone could help me out with this.

I want to write a script that when executed will get lots of details from 10
different Unix(AIX) and Windows(XP) boxes and generate a report.

The details to be gathered about the machines include :

1) Names and versions of all the softwares on the machines.

2) Disk space usage.

Etc...

Please guide me how I could go about it...

I am not aware of how a script running on 1 machine take data from commands
that are to be run on other...(like rsh)

Thanks in advance
-aman


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to