Python Forum
Aggregate multiple telnet connections
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Aggregate multiple telnet connections
#1
Hello,
Fist of all, I am a real newbie with Python but I know some other languages. I hope I will be able to learn Python...

I have 3 devices which send their log via telnet protocol, and an appliance (kinf of telnet client) which connects via telnet to retreive the logs.
My concern is that this appliance can connect to only one remote device.

So I would like to create a script which connects to 3 (or more) different devices with telnet but also listen on telnet protocol so that the appliance will only connect to the script and retrieve all the "aggregated" logs.

Would you please point me on the right direction?

I have played a little bit with telnetlib, but I can't figure out how to parallelize multiple clients and redirect the content to one server.
Reply
#2
Python provides a lot of support for concurrency: https://docs.python.org/3/library/concurrency.html

I would probably start by using Threads and a concurrent queue; each thread connects to a device and puts its log information on the concurrent queue. A different thread accepts connections from the "appliance" and pulls data from the queue and sends it to the appliance.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  telnet from ssh tunnel oldfart 3 7,169 Jul-17-2020, 02:28 PM
Last Post: noobami99
  telnet to a device under tacacs management kang18 0 1,569 Jun-05-2020, 06:11 AM
Last Post: kang18
  3.6 telnet eyler 3 11,289 Jun-28-2019, 05:22 AM
Last Post: Khanhamid90
  Any suggestion on python library to use for both ssh and telnet? lord_mani 4 3,750 Jun-25-2019, 04:07 PM
Last Post: gb74razor
  Select of connections Gupi 1 2,098 Jun-04-2019, 09:32 AM
Last Post: Gupi
  telnet question jacklee26 2 2,497 Mar-30-2019, 06:45 AM
Last Post: jacklee26
  Retrieve output from telnet command Networker 1 4,111 Mar-12-2019, 01:36 PM
Last Post: searching1
  Multithread telnet not working Parallel anna 7 7,459 Feb-05-2018, 01:17 PM
Last Post: anna
  Python telnet script for IP list mangesh 1 61,005 Jun-26-2017, 11:12 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020