Hi,
I'm trying to use the Net::Telnet module to talk
to a port a remote machine. There is an application
on the remote machine (on a specific port) that
takes a username/group as input and returns whether
the user is a member of said group. No logging in
is done at all.
An example (done from the shell)
telnet host.domain port
Trying xxx.xxx.xxx.xxx... <- remote machine
Connect to host.domain <- remote machine
Escape character is '^]'. <- remote machine
At this point I would enter the username group combination
User Group
If it's a "1" then the user is a member of that group, 0 is not.
Ok, now to the problem.
A snippet of my code:
$connect = Net::Telnet->new (Port => 1111,
Timeout => 5,
Input_log => "/tmp/input",
Dump_log => "/tmp/dump");
$connect->open(Host);
$results = $connect->cmd(Username Group); (This is line 21)
print "Results is $results\n";
Results is not printed, and at the command line I see
pattern match read eof at ./telnet.pl line 21
Looking at the input_log above, it contains a "1", which is
correct, because the User is a member of that group. It also
has a "0" when I've used a combination I knew that wouldn't work.
I'd like to capture the results of the command in the $results scalar
above. How do I go about and doit?
Thanks.
P.S. Using the print() and waitfor() combination, resulted in a
timeout error. If I set the timeout, the /tmp/input file was empty.
--
Ken Hammer
University Of Michigan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]