Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am a cisco engineer and am wanting to learn ways to automate tasks for router and switches and pull info, etc...

I am unix/linux challenged. So I deal with windows. Perl or Ruby keep coming up but I was told Perl or Ruby dont work well with windows.

I also hear windows powershell, which replaced batch files, is pretty good or even TCL scripts.

Any suggestions would be appreciated and if there are some cisco guys out there jump in.

share

migration rejected from superuser.com Aug 6 '13 at 19:43

This question came from our site for computer enthusiasts and power users. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as primarily opinion-based by Michael Hampton Aug 6 '13 at 19:43

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Also see: serverfault.com/questions/98925/… if part of what you want to do is submit commands remotely via the web interface. –  MikeyB Feb 10 '10 at 15:30
    
Saw this as I was doing a search. Perl (ActiveState Perl version) works great under Windows. We have used it to manage Windows systems, SQL Server, and Cisco network devices. –  K. Brian Kelley Dec 17 '10 at 15:45

12 Answers 12

if u are trying some thing to do a show command on each interface this might help

tclsh for {set i 1} {$i < 49} {incr i} { puts [exec "show authentication sessions interface gigabitEthernet 2/$i | i dot1x"]}

share

If you wont some automation runnin on your switch, you can use TCL. See: Cisco IOS Scripting with Tcl

share

Here's an answer for you -

  1. If you're really programming-challeged, the easiest solution would be bash shell and eXpect based programming. A lot of people I know who are deeply programming challenged use these to get through.

  2. If you're a bit better at programming(you understand it well), get into Python programming. Its rather easy and high level (easier for you to program) and there are a lot of good programs and libraries to communicate with routers and switches in it.

If you need further help, start with reading about TftPy library or send me a PM...

share

If you know net-snmp, scripting can be as simple as running snmpwalk/-get commands and parsing the output in your script. Then you can progress to using libraries directly in your code, start utilizing expect or alike and ssh libraries, etc. But net-snmp should be your starting point if you are interested in exploring unix/mac os x world as alternative to windows.

share

There is alot to be said about good old SNMP. Cisco equipment exposes alot of information this way, and you can even do some config via the private community.

share

What's probably less expensive than Ciscowork (although not free) is a product called ZOC (SSH/Telnet Client). It's scriptable so you can use it to telnet or SSH to a router and send commands or log replies from the router.

Here is a question from superuser.com with a simple script which indicates how it works: link.

share

We use Ciscoworks at work. It costs money, and is a resource hog in regards to server requirements, but it is supported by Cisco and does what you ask it to, at least once you get over the initial learning curve.

share

One thing I've always loved about Cisco, the config files are in plain text. This means you can use several different tools to help manage your configs. (I am assuming that you already backup your configs via tftp)

  1. Put all your configs under revision control. I would recomend git, it very simple and requires no server. Just the executable. Here's a version for windows.
  2. Once under revision control, start using a diff viewer. You can see the changes made, and only the changes made. Notepad++ has one built-in.
  3. Take a serious look at NCG (Netomata Config Generator). It's a brand new configuration managment system for switch and router configs (it's free, as in speech and beer, more on that below)

These are listed in importance. I've made it to number 2. I'm still working on number 3, but here's what I know so far:

NCG (Netomata Config Generator) is a network device configuration generation system written in Ruby (it popped up again). This way, your provisioning can be programmatic rather than ad-hoc. Here's some copy that I stole from their web site:

In a nutshell, we're building tools to automate the configuration of network systems, in order to make networks more reliable and scalable.

Basically with NCG you create templates (with a little ruby code); this is most powerful when you are trying to allocate VLANs across many switches. Here's a complete (and complex) web hosting example from Netomata.

For those who know puppet. NCG is like puppet for network devices.

Also, if you know any programmers start talking to them about what they find useful. They have tons of experience dealing with these kinds of problems. It may just be easier for you to write a shell script to generate the annoying parts of the configs (like vlans) rather than learning an entire language.

Finally if you're looking to pull information from the routers and switches (I am assuming stats like Number of ARP Cache entries, Memory, CPU, Load, etc.). All of this information can be obtained through SNMP. And there are so many ways of capturing and graphing SNMP information that it boggles the mind.

There are many server based, or ad-hoc systems that can be useful. If you want something Windows native try Solarwind's Engineer's Toolset, just bear in mind most (if not all) of these tools can be found for free (or built) in a Linux environment.

share

Kiwi Cat Tools also does this.

http://www.kiwisyslog.com/kiwi-cattools-overview/

share

Teach yourself Linux, the original Cat5000's were based on UNIX and many networking products now days are linux based (Checkpoint SPLAT, F5's OS, many more) Once you know a bit about Linux and Bash then learn Python. Plus Linux gives you amazing compatibility with syslog, ssh and other tools that you have to install to get working on Windows.

share
1  
Why not just learn IOS? Your suggestion is like saying to learn Latin so that you can understand Spanish because Spanish is a derivitive of Latin. Why not just learn Spanish to begin with? –  joeqwerty Nov 12 '09 at 12:47

RANCID would also work. I've never used it personally, but according to the website, seems to do what you want.

share
    
We use it; it's good. –  Zanchey Nov 12 '09 at 13:18

Expect is exactly what you're after and will work on both Windows and Unix. There are lots of Cisco/Expect examples on Google!

share