Showing results for 
Search instead for 
Did you mean: 

C++ guidlines

This document was generated from CDN thread

Created by: ILIAS TZIMOURAKAS on 26-04-2011 10:13:44 AM
Hello. I have a UC520 and an SR520 cisco routers. I use Visual C++ on windows OS. I want to develop a program that will configure my routers. So i will need to be able to configure all IOS CLI comamands. As far as i understand i can use XML API to configure CM (i believe CME also) related options and commands. Is it possible maybe with anohter API to develop a program that configures my routers. Speciffically i want to manage to configure my directory entries of the UC520. But it is something that will later expand to others configuration tasks. So any guidlines available are accepted. What are my option. Please be a little specific because i am not so experienced programmer.
Thank you.

Subject: RE: C++ guidlines
Replied by: Tanner Ezell on 31-05-2011 02:41:17 PM
You'd need to write an application which open a connection (telnet/ssh) and send ios commands. There is no specific API I am aware of for what you want.

I believe you can push changes with SMTP but I'm not 100% certain.

Subject: RE: C++ guidlines
Replied by: Aaron Graham on 17-06-2011 09:28:43 AM
The company I work for has developed a C++ application that uses ssh connection to automatically send CLI commands that are executed using the control provided by TCL (Tool Command Language). In some of the Cisco devices a onboard TCL interpreter is provided. When it wasn't provided (for example the embedded 3750 switches or ASA firewall or even 3rd party PEPs), we used a TCL interpreter on the PC that would run the scripts and (when appropriate) send the IOS commands via the SSH connection to any router/switch that uses a k9 (SSH) IOS build.

I used a state machine (implemented as a C++ thread) for each piece of equipment that we wanted to configure automatically. These state machines look for particular text that was returned from the CLI to determine transition(s) from state to state.

If your devices accept the "tclsh" command from the ¿enable¿ prompt, then they will support TCL. You will most likely be able to do all you want with TCL on the devices themselves. You can load TCL scripts via a TFTP server if you wish and execute them on the Router.

The Tanner Ezell may have meant SNMP instead of  SMTP. SNMP can also push configuration changes from a remote location.

Good luck.


Several years ago, I've developed a C++ process (running on Linux RedHAT 7) that connects via SSH to Cisco routers (IOS 12.2).

The process's task is to monitor (retrieve&update) some preconfigured ACL and it uses the libshh 0.7.0 version (

The ssh_set_blocking(session, 1) command is activated prior to the ssh_connect(session) one.

Several months ago, we've received two new Cisco routers with the IOS 15.1, and since then there is the SSH connection problem.

I've written a simple tester that loops (100 cycles) over all the Cisco routers (IOS 12.2 and the new IOS 15.1 ones). The tester just connects, disconnects and sleeps for 2 seconds.

All the 100 tests performed on the Cisco routers with IOS 12.2 - were successful.

Only 75-85 tests performed on the Cisco routers with IOS 15.1 - were successful, the other 15-25 attempts failed due to the timeout error.

What are the IOS 15 changes that could cause this problem, and how may I solve the problem?







Recognize Your Peers
Content for Community-Ad