Python Forum
Python telnet script for IP list - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: Python telnet script for IP list (/thread-3808.html)



Python telnet script for IP list - mangesh - Jun-26-2017

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


RE: Python telnet script for IP list - DeaD_EyE - Jun-26-2017

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.