- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Automated Telnet on HPUX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 08:52 PM
тАО07-20-2004 08:52 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 08:54 PM
тАО07-20-2004 08:54 PM
Solutionyes it is
# hostname is the name of the remote machine
# username is the name of the user
# password is the password of the user username
REMOTE=hostname #or IP address
(sleep 5
echo username
sleep 5
echo password
sleep 15
echo "ls -ald /tmp" #Your command
sleep 5
echo exit) |telnet $REMOTE
Regards
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 09:27 PM
тАО07-20-2004 09:27 PM
Re: Automated Telnet on HPUX
You do not specify where from you want to telnet HPUX.
From a PC, you can find some scripting facilities with the terminal emulation software. We have for Reflection for Unix (you can record a session and then edit hte script). I believe this available with other sw.
From Unix, you may use "expect".
Never used it myself, there a few threads in the forum on Expect.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=500029
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=523669
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=590954
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 09:39 PM
тАО07-20-2004 09:39 PM
Re: Automated Telnet on HPUX
you should use expect as a script language for this kind of interaction:
expect can be downloaded from software.hp.com
expect comes from :
http://expect.nist.gov/
You may use a script like:
==================================
#!/bin/sh
# exec expect "$0" ${1+"$@"}
set host [lindex $argv 0]
set login [lindex $argv 1]
set password [lindex $argv 2]
spawn telnet $host
expect "Username:"
send "$login\r"
expect "Password:"
send "$password\r"
interact
==================================
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 09:44 PM
тАО07-20-2004 09:44 PM
Re: Automated Telnet on HPUX
Perl solutions are also possible.
Your script would look something like:
===================================
use Net::Telnet ();
$telnet = new Net::Telnet;
$telnet->input_log($LOG);
$telnet->open(Host => $host, Port => $port);
# $telnet->timeout(60);
$telnet->waitfor(String => '>');
$telnet->print($user);
.....
=========================================
hope this helps too!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 10:01 PM
тАО07-20-2004 10:01 PM
Re: Automated Telnet on HPUX
Please explain me little bit more your perl script ( am not a perl man ) .for exapmle there is no specification of passwd there . it looks like you are using a class .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2004 12:26 AM
тАО07-21-2004 12:26 AM
Re: Automated Telnet on HPUX
this is another piece of example from the docs:
=================================
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die'
Prompt => '/\$ $/i');
$telnet->open('yd.server.mu');
$telnet->login('ydyd', 'bindaas');
print $telnet->cmd('who');
=================================
see also:
http://www.perlfect.com/articles/telnet.shtml
hope this helps!
regards
Yogeeraj