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
1
vote
1 answer

Python Telnet Scripting

I am new to python scripting, but I have made a script that works with other devices on my network. I am trying to modify a script that will instruct the remote device to backup its config to a TFTP server. It works fine for my 3Com, HP switches,…
1
vote
1 answer

Combining string with text in telnetlib write command doesn't work if string has spaces in

I'm using the telnetlib to read a text file from a webserver and push out the lines to an LCDProc server rotating them every few seconds. Everything so far works ok unless there is a space in the imported line. I've read the python documentation…
LostRob
  • 433
  • 1
  • 4
  • 12
1
vote
1 answer

Telnetlib read_until() and expect() not detecting terminal echo

I made a script in python that uses the telnetlib module for telnetting into a linux device, running an install.sh file, then rebooting upon completion. Upon completeion of the install.sh script, I added a line that sends echo "install complete" to…
pwillig
  • 101
  • 1
  • 7
1
vote
2 answers

Python: select() returns immediately without no data to read (telnetlib)

I want to use select.select() to block the loop until some data is ready to be read from a list of telnet sessions. However, the below code does not work and the call to select.select() returns immediately with no data to read. I'm using python…
danidelvalle
  • 146
  • 1
  • 7
1
vote
2 answers

Write in to telnet session telnetlib

I need to get a connection to a device via TELNET and write in to telnet session. I Use - Python 3.3.2 and PyDev For Eclipse 2.7.5 I use IP2COM cause it allows me to open another telnet to the same device and see how the commands are executed. The…
Nick
  • 41
  • 1
  • 6
1
vote
1 answer

Clear the output buffer in telnetlib on Python 3.2

I want to establish one telnet connection but I don't want to see in the terminal what I write and read. e.g. tn = telnetlib.Telnet(host) tn.write(command.encode('ascii') + b"\n") time.sleep(0.1) ret = True if b'iconstorage' in…
Cooli
  • 169
  • 3
  • 14
1
vote
1 answer

Using telnetlib. How to make use of a response after writing a command

I am extremely new to Python and after several weeks of study and practice programming I have begun my home automation project. My aim is to interact with a Java based service that runs on my Windows machine called C-Gate. This then interprets and…
whittie83
  • 13
  • 3
1
vote
1 answer

handling telnetlib timeout error in python

I am trying to write a python script to establish a telnet connection (using telnetlib) to a range of hosts: for i in range(len(HOST)): print "scanning " + HOST[i] + " ...\n" tn = telnetlib.Telnet(HOST[i],23,3) The problem is when one of…
user2215910
  • 13
  • 1
  • 1
  • 3
1
vote
1 answer

Python telnetlib determining different login prompts

I've written a python script that can log into multiple devices sequentially by reading a csv file listing the different IP addresses. From there it outputs a file for each device with the content from a few commands that are passed to the devices…
2ndg33r
  • 81
  • 7
1
vote
2 answers

Using Python telnet lib w/o logout command

I am trying to use python's telnetlib module to get information from a remote device. Unfortunately, it looks like the remote device does not have a "logout" type of command. So you have to manually close the connection with CTRL-] (when manually…
slappyjam
  • 69
  • 2
  • 10
0
votes
1 answer

Capturing telnet session - pexpect and telnetlib too slow

I want to pull connection tables from a firewall. In some cases it can be more than 200k lines of "TCP outside 46.33.77.20:53415 inside 10.16.25.63:80, idle 0:00:04, bytes 3230, flags UIOB" and the like. I've tried to implement both pexpect and…
BDub
  • 11
  • 3
0
votes
1 answer

Code to login to remote directory and search a file and download in Python over FTP

I've a package with .gz and filename as (xxxxxxxxxxxx_PARSERxxxxx.tar.gz) extension placed in a remote directory say 1.1.1.1(Should be a input as a variable), i'm currently running the script from machine say 2.2.2.2, i need to place the package in…
Kiran
  • 21
  • 5
0
votes
1 answer

telnetlib | read all message when I have to click space if do it mannually

As you know, sometimes, you have to click space to get the next page under telnet connections, unix. For instance, you 'more' a text file. You can't get all the content at one time. Using 'space' can get to the next page. Here is the problem, what…
Mars_Taxi
  • 61
  • 1
  • 5
0
votes
1 answer

Timeout and high cpu load problems using multiple telnet connection threads in python

I want to connect to multiple telnet hosts using threading in python, but I stumbled about an issue I'm not able to solve. Using the following code on MAC OS X Lion / Python 2.7 import threading,telnetlib,socket class…
0
votes
1 answer

connect telnet with python

I tried to connect bbs with python's library "telnetlib", try to make a robot to answer the message. While I answered the message,the robot return more than 1 message.These are my code. # -*- coding: cp950 -*- import telnetlib,random #f=…
Oberon
  • 628
  • 1
  • 6
  • 12