1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Rep Power

    Run Script Multiple Time Silmutanies

    Thanks to you guys I'm almost finish the script that I was ask to done in my job.When was asked, I just knew little bit about scripting, but I liked the challenge and I told them that I'm willing to do it. I'm a network engineer, so as you might know by my previews post, my script is ablut ssh into cisco devices. I finish my script, but the list of devices that I to run it is really big. I did a test run, and the script is been running for hours(2000) devices. My question is how can I run the script and instead of the script SSH into each device at a time, the script will SSH let say 4 times at a time simultaneously. Thanks in advance
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power

    The multiprocessing module is quite easy to use, it might help.

    Also, without refreshing my recollection of your earlier solution so this advice may not apply, process creation takes a lot of resources. Arrange your code to have more commands per process and fewer processes.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo