From: shiran guez (shiranp3@gmail.com)
Date: Thu Jan 22 2009 - 14:01:59 ARST
I use python as it is more flexible then expect and much easy syntax then
perl here is an real small exmple but you can actually do what you described
you need in not much more code lines:
============================================================
#!/usr/bin/python
import getpass
import sys
import telnetlib
HOST = raw_input("Enter your remote address: ")
user = "user"
password = "pass"
enable = "enapass"
tn = telnetlib.Telnet(HOST)
tn.read_until("Username: ")
tn.write(user + "\n")
if password:
tn.read_until("Password: ")
tn.write(password + "\n")
tn.write("enable\n")
if password:
tn.read_until("Password: ")
tn.write(enable + "\n")
tn.write("show ip int b | ex una\n")
tn.write("exit\n")
print tn.read_all()
========================================================
Good luck
On Wed, Jan 21, 2009 at 1:02 AM, Tyson Scott <tscott@ipexpert.com> wrote:
> Perl or Expect will provide you the greatest functionality and
> customization
> in my opinion. Perl has a lot more examples that you can easily obtain off
> of the internet. Expect is a great tool for network admins.
>
> Regards,
>
> Tyson Scott - CCIE #13513 R&S and Security
> Technical Instructor - IPexpert, Inc.
>
> Telephone: +1.810.326.1444
> Cell: +1.248.504.7309
> Fax: +1.810.454.0130
> Mailto: tscott@ipexpert.com
>
>
> -----Original Message-----
> From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
> testing testing123
> Sent: Tuesday, January 20, 2009 5:27 PM
> To: ccielab@groupstudy.com
> Subject: script to log into cisco csm load balancer
>
> What language should I use to write a script to log into my cisco csm
> load balancer and check the usage ? The place I work for doesn't have
> any industry tools like HP Openview, CIscoworks, solarwinds, or
> anything like that. I want it to log into the csm once every half
> hour and check the connections of the serverfarms and export it to a
> spreadsheet that will automatically graph that data.
>
> thanks
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html
>
>
>
>
>
>
>
>
-- Shiran Guez MCSE CCNP NCE1 JNCIA-ER CCIE #20572 http://cciep3.blogspot.com http://www.linkedin.com/in/cciep3Blogs and organic groups at http://www.ccie.net
This archive was generated by hypermail 2.1.4 : Sun Mar 01 2009 - 09:43:39 ARST