Questions tagged [telnetlib]

The telnetlib module provides a Telnet class that implements the Telnet protocol under Python programming language.

The telnetlib module provides a Telnet class that implements the Telnet protocol under Python programming language.

See RFC 854 for details about the Telnet protocol.

In addition, telnetlib provides symbolic constants for the protocol characters (see below), and for the telnet options. The symbolic names of the telnet options follow the definitions in arpa/telnet.h, with the leading TELOPT_ removed. For symbolic names of options which are traditionally not included in arpa/telnet.h, see the module source itself.

Read more about telnetlib at python docs..

318 questions
0
votes
1 answer

telnetlib write() some command not working in Python

I'm using Python's telnetlib.write() function for quite some time without issues, but in this case the command that I want to send does nothing. While the same command sent through SecureCRT works fine. Here's more or less what I have: import…
leshurex
  • 23
  • 1
  • 5
0
votes
0 answers

class creation concerns, python 3.4

So, i'm creating an automated test system(scope bloat - the original intent was a one-off bash automation of a particular test case that has turned into creating a system that will do many other things). i've done a few things similar to this, but…
Jiynx
  • 306
  • 1
  • 6
0
votes
1 answer

Python (Django). Store telnet connection

I am programming web interface which communicates with cisco switches via telnet. I want to make such system which will be storing one telnet connection per switch and every script (web interface, cron jobs, etc.) will have access to it. This is…
Shamanu4
  • 5,296
  • 2
  • 27
  • 31
0
votes
1 answer

Not Getting any responses from telnet in python

Server is connecting though. Alternatively I tried commands in putty and got the response from there but I dont know why the code is not working: Here is the snippet of it that is not working import telnetlib host = 'aspmx2.googlemail.com' timeout…
0
votes
0 answers

Python : Handling multiple telnet sessions to same IP

I have few list of commands (any number), which have to be executed over telnet on one particular IP/HOST. And the output to be stored in separate file. These commands are specific to log collection. I need them in such a way that, Execute all…
Jackie James
  • 785
  • 8
  • 15
  • 28
0
votes
0 answers

telnetlib script working on Windows 7 Prof but not on Windows server 2012 R2

Hi I'm running the following telnet script from python as well as from powershell. In python I'm using telnetlib and running the following: import telnetlib HOST = "hostname" PORT = 25 TIMEOUT = 5 def test_telnet(Host, Port, Timeout): tn =…
Aks
  • 932
  • 2
  • 17
  • 32
0
votes
0 answers

Python - Telnet closes before waiting for a print read function

I am making a python script that conects to Teamspeak 3 Server Query telnet and listens out for commands (I haven't figured out the command part yet). But right now the telnet doesn't wait till a response is made, should i be using another library…
Khailz
  • 89
  • 1
  • 12
0
votes
1 answer

Python - Telnetlib socket.gaierror:

I am trying to create a telnet to Teamspeak 3 Server Query through python, this is my code: __author__ = 'Khailz' import telnetlib, socket HOST = "unlightedgaming.com" port = 10011 timeout = 5 for i in range(len(HOST)): print "scanning " +…
Khailz
  • 89
  • 1
  • 12
0
votes
1 answer

Searching throughout telnet output result while doing parallel telnet to multiple network devices

I am trying to find a string (e.g.: ZNTS) from telnet output to a host. I want to telnet to multiple hosts at the same time because waiting to finish from host to host takes a long time. The host can not response fast enough, so I need to sleep…
chanty
  • 1
0
votes
1 answer

Telnetlib python write() not working as expected

I am trying to automate a set of telnet commands used when configuring a linux server. I am currently trying to use Python 2.7 for this and thought that telnetlib would be the way to go. But unfortunatly it doesn't work as I would expect. tn =…
jimmy
  • 1,981
  • 3
  • 19
  • 28
0
votes
0 answers

Connecting to telnet servers with Python

I want to interactively connect to a telnet server in Python and be able to both read and write text to the server. I am trying the following code to connect: import telnetlib host =…
chopper draw lion4
  • 12,401
  • 13
  • 53
  • 100
0
votes
1 answer

Fluidsynth with Telnet and Python: No sound

I've been working with Fluidsynth on a Raspberry Pi B running Raspian (not the absolute latest image because Fluidsynth wouldn't run on the latest version but from at least April 2014). I start Fluidsynth by running fluidsynth -a alsa -g 1 -s -o…
0
votes
0 answers

How to send “shift+F11” with telnet in python

I have to send Shift + F11 key to telnet host(tn5250), how do I send it using python? For example, to send Shift + F1, I am using this sequence of characters \x1B[25~ I know there is some logic involved in conversion of keyboard's keys to ASCII…
Avi
  • 368
  • 2
  • 13
0
votes
1 answer

telnetlib other ways to press Enter , can't proceed with script when a server is just booted up

I run python script using telnetlib on linux virtual machine. 99% of the time, tn.write('\n') works smoothly. But there's a case when a server is just booted up, in the real console, first user logged in needs to press Enter on the keyboard after…
user3352539
  • 79
  • 1
  • 1
  • 8
0
votes
5 answers

Python Error Handling & Connection Errors

I'm working on a Telnet client. I started coding on my notebook(Windows) and at the finish I uploaded it on my server(Debian). Both systems works with Python 3. At my notebook the script works well, but on Debian, it does make errors. The…
miny1997
  • 469
  • 3
  • 13