Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to telnet from bamboo

Aziz Fall December 7, 2014

Hello,

I would like to send a telnet from bamboo through a script. But it is not working. Is there any way to telnet from Bamboo server? Is there any configuration to do as prerequisite before launching a telnet.

I tested the telnet from a windows prompt on the bamboo server and it works. But not from the script i have created on bamboo.

 

Regards,

 

Aziz.

5 answers

1 accepted

0 votes
Answer accepted
Paul Fink December 8, 2014

Telnet is an interactive program. It is not intended to be used in scripts.

Radu show how to use unix/linux style pipe to send interactive commands to telnet

but I doubt that will work on windows. 

Its really impossible to say what the solution would be without knowing more about what your trying to do.

0 votes
Paul Fink December 9, 2014

Again telenet is an interactive program. As Radu's link points out.

If you don't want to use ActiveX as suggested in the link, then look at python. There is a telnet lib and you could start using more robust technologies.

http://www.pythonforbeginners.com/code-snippets-source-code/python-using-telnet 

0 votes
Aziz Fall December 8, 2014

Hello Guyz,

Thank you all for your responses.

To give you more details:

1) In fact we created a VBS script on which we put the different commands (credentials and requests) to access to our remote system.

 

2) This VBS script is called by a windows script (.bat) with below lines:

 :: Open a Telnet window
start telnet localhost
:: Run the script
cscript SendKeys.vbs

3) When we execute the windows script (.bat) from the bamboo server it is working fine.

4) Then we tried to add the script as a Script task in Bamboo. But from our Bamboo plan the script seems to be called (we put some logs to check it) but the telnet seems to be not executed.

 

That is actually our issue and the only way we have to connect to our system is through telnet.

 

Can you help,

Thank you in advance,

 

Regards,

 

Aziz.

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2014
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 9, 2014

@Radu Dumitriu convert your "Reply" to "Answer" I think this is what Aziz is looking for.

0 votes
Krystian Brazulewicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 8, 2014

Aziz - I'm pretty sure that your ability to run telnet to the other machine needed some configuration. Make sure this configuration is also valid for an account that Bamboo is running on. I see you're mentioning Windows so this will be Local System account

Edit: Also as @Radu Dumitriu mentioned ssh provides more secure method of connecting between hosts (although is not available on windows out of the box)

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2014
(echo username; sleep 1; echo password; sleep 1; echo "put_command_here"; echo "quit" ) | telnet host

If you're on telnet => you have little or no security concerns, therefore it may worth to ask yourself if rsh/rlogin would help you (I know it's out of fashion but they'll do the job)

Anyway I would use ssh anytime:

ssh user@host "put_command_here" 

(but configure it not to ask a password via RhostsRSAAuthentication)

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2014

well, Krystian & Paul have a point here. I always assume that people use decent OSes. Yes, on windows just install cygwin or something. Piping should work on windows also, but ....

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2014

(mea culpa)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events