Submit a ticketCall us

whitepaperYour VM Perplexities Called, and They Need You to Read This.

Virtualization can give you enormous flexibility with future workloads and can be a key enabler for other areas, like cloud computing and disaster recovery. So, how can you get a handle on the performance challenges in your virtual environment and manage deployments without erasing the potential upside? Learn the four key areas you need to be focusing on to help deliver a healthy and well-performing data center.

Get your free white paper.

Home > Success Center > Network Configuration Manager (NCM) > NCM - Knowledgebase Articles > Download Multi Context Configs for Cisco ASA or Cisco FWSM

Download Multi Context Configs for Cisco ASA or Cisco FWSM

Table of contents

Updated September 20th, 2016


This procedure only applies to network devices that have multiple context with individual running configurations, and the IP address is not able to be added to NCM as a separate node.


All versions of NCM prior to NCM 7.4.x  For NCM 7.4 and after Click Here


  1. In Settings>NCM Settings>Configs , add a new Config Type for each context (for example Context1, Context2).

  1. Specify in your device template, how to switch to each context (see example below).
  2.  ${ConfigType} macro in the Reset Command.
  3. specify the RegEx value in the Reset command. Depending on your prompt settings, the value should be '#', '>', ']', etc.
  4. Avoid using ${ConfigType} macro in the DownloadConfig command. Make sure the command is the right one, e.g. "show configuration", "show running-config" and so forth.
  5. In the Command line defining the Context \ Config Type, defining the command, the Context name is case sensitive
  6. The actual command may be different on different platforms. In this example, it is for a FWSM or an ASA with Multiple Contexts
  7. Because we have to flip logic in NCM to allow the changing of prompts, only able to receive either the running config or the startup config can be gathered for any context, to include the admin.


Device Template Example:

<Command Name="RESET" Value="${ConfigType}" RegEx="#" />

<Command Name="Context1" Value="command to switch to Context1"  />

<Command Name="Context2" Value="command to switch to Context2 "/>

<Command Name="DownloadConfig" Value="show configuration"/>

<Command Name="UseMultipleDownloadCommands" Value="True" />

*** Note***

In the example above, the Words Context1 and Context2 need to be replaced with the actual Context  name as defined when creating the customized config type created in NCM.

Best practice would be the Config Type would be the actual Context name on the devices. 



When NCM downloads a configuration, the first command issued is the ‘Reset’ command defined in the device template.

The ${ConfigType} macros will be replaced by the appropriate switch context command, based on the config type selected for the dowload.

The context will be dynamically switched before the download command is executed.

When the context is changed, so is the prompt. In order to recognize the prompt, a regular expression (RegEx) must be used to ignore the variable part of the prompt.



Let’s assume the command mode prompt after login is : ASA#

  • After switching to Context1, the command mode prompt becomes ASA-Context1#.
  • After switching to Context2, the command mode prompt becomes ASA-Context2#.

The RegEx to use in the reset command should match the common portion of the prompt in both contexts. In this example this could be RegEx="#".


Last modified