Paramiko - https://github.com/paramiko/paramiko
You can install it with "pip install paramiko" command
Disabling only physical interfaces(L2) like GigabitEthernetX/X/X,FastEthernetX/X/X, XGigabitEthernetX/X/X and etc.
Tested with AR2504-D-H, S5700, S5720, AR3260(has a bug: disabling each interface two times). Over 10000 ports were disabled in large service provider network
--mode show/shut:
"show" - only print interfaces that able to be shutdowned because their operstatus is DOWN and there is no description;
"shut" - send interface *** shutdown command
--devip *device_ip*:
execute script only for this ip
--fname *name_of_file_with_extention*
parse your file to get device names and device ip adresses
DEVICENAME1 192.168.1.1
DEVICENAME2 192.168.1.2
DEVICENAME3 192.168.1.3
DEVICENAME4 192.168.1.4
DEVICENAME5 192.168.1.5
DEVICENAME6 192.168.1.6
You can see example in devices_example.txt
python3 main.py --mode=show --devip=192.168.1.1
or
python3 main.py --mode=show --fname=devices.txt
errors.txt: all errors here
success_disable.txt: device names, ip's and list of ports which are disabled. Only in "shut" mode
success_print_cadidates.txt device names, ip's and list of ports which can be disabled. Only in "show" mode