Python Forum

Full Version: Python telnet script for IP list
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.