Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.038 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'socket': 0.07; 'already.': 0.09; 'connect,': 0.09; 'subject:skip:c 10': 0.09; 'tcp/ip': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'afterwards.': 0.16; 'cui': 0.16; 'factory': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'port,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'module': 0.19; 'not,': 0.20; 'reset': 0.22; 'cc:addr:python.org': 0.22; 'text,': 0.24; 'initial': 0.24; 'cc:2**0': 0.24; 'push': 0.26; 'header:In-Reply-To:1': 0.27; 'fixed': 0.29; 'dec': 0.30; 'errors': 0.30; 'message- id:@mail.gmail.com': 0.30; '(unless': 0.31; 'probably': 0.32; 'worked': 0.33; 'url:python': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'url:org': 0.36; 'url:library': 0.38; 'whatever': 0.38; 'pm,': 0.38; 'does': 0.39; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'url:3': 0.61; 'simple': 0.61; 'back': 0.62; "you've": 0.63; 'cisco': 0.68; 'frank': 0.68; 'sound': 0.68; 'default': 0.69; 'yourself': 0.78; 'blob': 0.84; 'partial': 0.84; 'presumably': 0.84; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Ntw2YowVym/sJep6PiIj/M8KEWB0wp3tKXtCRZQ1uQE=; b=iiIYCkjTXsf+DW3/w0QS7nlIyReT5pgvxDOHx0pK2ii+xA39UbMxatHsPBgRyQo8UG wupmsxMrz8Do1rggMy3qJJ6IOO53UItSZckvqnWQZ4YDkr41CWlm0t5N5GHzy2xJPy4H WzRyABLvCSdYZdtO46AtFdUYvfDaCuATs/bkw86RsKSFR4vUjexI3SZUe9fGfl6Qo5D3 6O7HUjQPq/sgsODuNPpirmF/QqouLUWu6MywtxSkkIsL4NAv5nN94VZ7IK6JPIOIeVnl 2dPgQ0327u3RrcONBvR6Tus4SEamCFsGzbm+3/jISyt1G1qyJmL4sCVJAj6FtkolwS8l CcKA== MIME-Version: 1.0 X-Received: by 10.68.111.33 with SMTP id if1mr31540647pbb.31.1387337275395; Tue, 17 Dec 2013 19:27:55 -0800 (PST) In-Reply-To: References: Date: Wed, 18 Dec 2013 14:27:55 +1100 Subject: Re: seeking a framework to automate router configurations From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387337284 news.xs4all.nl 2901 [2001:888:2000:d::a6]:55345 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62260 On Wed, Dec 18, 2013 at 1:40 PM, Frank Cui wrote: > "Asynchronously reset a large number of cisco routers back to their original > configurations and push prepared initial configurations to them" >From the sound of your partial solutions, this is done over a TCP/IP socket? I don't know how you'd go about authenticating yourself with the router (unless the factory reset is done some other way, and the telnet part is just to push the config, in which case you'd be using the default credentials), but presumably you've worked that part out already. Python has a socket module which is probably what you want here. You can connect on any port, read what comes back, and send whatever you need. If the job's simple enough, you might even be able to just connect, send a fixed blob of text, and then listen for errors in the response... or even not, and just let the user try it afterwards. http://docs.python.org/3/library/socket.html Does that look like what you need? ChrisA