Python Forum
Python telnet script for IP list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python telnet script for IP list
#1
Hi,

I am looking for a Python script that can telnet a list of IP address in a saved file say "iplist.txt" and run a set of commands say "commands.txt" and save output in a file say "scriptlogs".


Thanks in advance,
Mangesh
Reply
#2
I don't know a ready script for it, but you can use libraries for it.
For example: https://pypi.python.org/pypi/telnetlib3
It requires Python 3.3+, better Python 3.6.

You can also program your own socket client with threading for example.

To read the file itself is a very easy task:

with open('iplist.txt') as fd:
    ips = fd.readlines()
But I'm to tired to do anything now and this is not the sense of this board. The people meeting here, when they do have problems with their program.
Start programing in Python and when you've problems, ask questions.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  telnet from ssh tunnel oldfart 3 7,063 Jul-17-2020, 02:28 PM
Last Post: noobami99
  telnet to a device under tacacs management kang18 0 1,540 Jun-05-2020, 06:11 AM
Last Post: kang18
  3.6 telnet eyler 3 11,210 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,669 Jun-25-2019, 04:07 PM
Last Post: gb74razor
  telnet question jacklee26 2 2,459 Mar-30-2019, 06:45 AM
Last Post: jacklee26
  Retrieve output from telnet command Networker 1 4,041 Mar-12-2019, 01:36 PM
Last Post: searching1
  Aggregate multiple telnet connections Jibeji 1 4,220 Mar-02-2018, 07:21 PM
Last Post: mpd
  Multithread telnet not working Parallel anna 7 7,355 Feb-05-2018, 01:17 PM
Last Post: anna

Forum Jump:

User Panel Messages

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