?
Solved

how to fire a telnet command other than expect

Posted on 2014-03-20
6
Medium Priority
?
781 Views
Last Modified: 2014-04-02
my telnet commands are:

1.  telnet localhost 6667  : this prompts a osgi promt

2.  osgi> bundle <number>

I need the output of the second command.
NOTE: It seems I dont have /usr/bin/expect on the server. It is a production server and i cannot install expect.
0
Comment
Question by:pvinodp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Accepted Solution

by:
Daniel Helgenberger earned 668 total points
ID: 39942931
NOTE: It seems I dont have /usr/bin/expect on the server. It is a production server and i cannot install expect.

The only way I know to script prompts is expect. You need it from the telnet client's side; so any client, not necessarily your server, will do.

However, if you do not need to login, this is worth a try:
telnet localhost 6667 << EOF
bundle <number>
EOF

Open in new window

0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 668 total points
ID: 39943085
Why don't you use a Java Telnet api?
0
 
LVL 13

Expert Comment

by:Daniel Helgenberger
ID: 39943178
Actually a very good idea; did not think about anything else but bash.

Though I would use something more common in Linux:, witch should work out of the box: Perl or Python. This way you can even overcome logins; but you nay still need libraries like net-telnet.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 664 total points
ID: 39943642
You could also run use expect on your test or development server and connect to the production server using "telnet <production server> 6667". Do you have expect experience?
0
 

Author Comment

by:pvinodp
ID: 39944516
i cannot reach my production servers. And i do not know expect, but i can learn if needed.

Yes, my server can run java program and perl.

I found few articles on java and telnet. But as said already, that would need library. Which offcourse is not part of jdk. i found one with org.apache.commons.net.telnet.

Is it possible to write this in perl?
0
 

Author Closing Comment

by:pvinodp
ID: 39972012
I think expect is the way.. i am going with it.
I need to have expect installed no matter what library I use
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question