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

Python errors with telnetlib

I have multiple errors with python's library telnetlib. When I use it from the repl, here is the code I enter: import telnetlib telnetlib.Telnet("", ) as tn: write("SYST:BEEP") It retrurns the following error: Traceback (most…
0
votes
2 answers

Python telnet read a long output issue

Here is my telnet script as: import sys import getpass import telnetlib import time HOST = "192.168.182.129" user = input("Enter your remote telnet account: ") password = getpass.getpass() tn = telnetlib.Telnet(HOST) tn.read_until(b"Username:…
Deepak
  • 1
0
votes
1 answer

Why is telnetlib continuing to write to file after tn.close statement? Also, it's sending my command twice

This script is supposed to open a telnet session with a remote device, send a command, and write the output to a file. The CC and CA stand for Ctrl + C and Ctrl + A. The only possible explanation that I can come up with is that the remote device is…
0
votes
0 answers

How to print continuously data from telnet with telnetlib (python 3.7)

I want to print continuously data (real time) from telnet with telnetlib (python 3.7) but no resalt becouse the fonction read_all don't stop import telnetlib tn = telnetlib.Telnet('10.205.61.60', port=9101, timeout=10) v=tn.read_all() print(v)
0
votes
0 answers

Python - Telnet or SSH multiple devices

I am currently using telnetlib and paramiko to connect to a server and gather some configuration from it. It took around 30 minutes to gather configuration of 50 servers. But now I need to connect around 50k servers. So by this method this is going…
Chandru Jc
  • 105
  • 10
0
votes
1 answer

im triying to comunicate with telnetlib to my yeelight desk lamp

im triying to comunicate with telnetlib to my yeelight desk lamp with commands like this:{"id":1,"method":"set_power","params":["on","smooth",500]} and im getting errors like…
0
votes
0 answers

Telnetlib: 'NoneType' object has no attribute 'sendall' False

note before starting - This issue is different than: 'NoneType' object has no attribute 'sendall' PYTHON IP addresses removed and replaced with x.x.x.x It appears that my code is sending the desired command, but then errors out with the 'Nonetype'…
0
votes
2 answers

Telnetlib output into text file to be called on as a variable later

I have a program that i'm trying to create for the purpose of searching the network for specific mac addresses. When I run the cisco command "show mac-address-table" it gives output that's saved to MH2. If that output has "000c." in it all the…
0
votes
1 answer

Using a single telnet session in two different methods

I need to use a telnet session like in this code below : class ModTelnet(MXComm): def __init__(self): MXComm.__init__(self) def _connect(self): #connect to telnet session @ localhost port 4444 try: HOST = "localhost" …
user732663
  • 1
  • 2
  • 4
0
votes
1 answer

How to check telnet client is installed or not on Remote windows machine

we have to test on 100 servers whether telnet is installed or not? if installed we have to check port is working or not (telnet 10.20.30.40 1234) if not installed we have to install and test the port is enabled or not? is it possible in Python…
sreenid
  • 53
  • 1
  • 1
  • 4
0
votes
1 answer

Having problems using telnet twice into server from python script

Working on my first python script at work to automate some testing. I'm having trouble telneting to a server twice from my script. The first time I'm calling the telnet function, everything works, the second time my script calls the telnet function,…
0
votes
2 answers

Using static NamedTuples variables outside of class in a function

I'm using a NamedTuple to define a server to which I want to connect using telnetlib. Then I created a class which defines the connection to the server, with the server details and connection method inside the class. Then outside of the class, I…
Alon
  • 99
  • 1
  • 9
0
votes
2 answers

How to pick out the second to last line from a telnet command

like the many other threads I've opened, I am trying to create a multi-feature instant replay system utilizing the blackmagic hyperdeck which operates over Telnet. The current feature I am trying to implement is an in-out replay which requires…
0
votes
1 answer

How to use a variable in session.write

So, I’m using Telnetlib with Python 3 to try and create a software replay station, and I’m trying to modify one of the telnet commands to change the time code based on a variable, but I keep getting a syntax error since the only way I can get it to…
0
votes
3 answers

forloop TypeError: can't concat str to bytes

I am new to python3, trying to convert python 2.7 code to python 3, and I get into this issue. Let me know where I am wrong. for n in range (755,767): tn.write(b"vlan " + str(n) + "\n") tn.write(b"name Python_VLAN_" + str(n) +…
Mir
  • 37
  • 1
  • 7