I am wanting to get the configs of each context on my multi-context asa. the nexus switches show all there contexts but the asa does not. any ideas on how to show all contexts and then configs related to each context?
thanks
I am wanting to get the configs of each context on my multi-context asa. the nexus switches show all there contexts but the asa does not. any ideas on how to show all contexts and then configs related to each context?
thanks
So we do this ... I'm not convinced it is the most elegant method but it works, which is a key starting point I guess.
We have created a device template and labelled it, for want of better wording, "Cisco ASA Multi Context Startup" and a 2nd one for "Running" which is essentially a duplicate of the startup. You cam start with the basic ASA template and work it up from there.
Next step is to edit the template, and here the XML editor is your friend, to add in each of the contexts that you want to download. BTW, once you've created the XML file you can later edit the entries via the interactive wizard if preferred.
Below is an extract from our template, starting at the write erase line as up to there is the same as the base ASA backup.
<Command Name="EraseConfig" Value="write erase${CRLF}Yes" /> <Command Name="SaveConfig" Value="write memory" /> <Command Name="Version" Value="show version" /> <Command Name="ChangeToSystemContext" RegEx="#" Value="changeto system" /> <Command Name="ChangeToContext" RegEx="#" Value="changeto context ${ContextName}" /> <Command Name="ShowInterfaces" Value="show interface ip brief" /> <Command Name="ShowContext" Value="show context" /> <Command Name="ShowMode" Value="show mode" /> <Command Name="System_Startup" Value="more system:running-config" /> <Command Name="Admin_Startup" Value="more disk0:/admin.cfg" /> <Command Name="NAME_OF_YOUR_FIREWALL_HERE_Startup" Value="more disk0:/NAME_OF_CFG_FILE.cfg" />
Take note of:
In node details : config tab you then have a specific download action. You'll have running / startup / and however many of the above you've configured.
We have then created 2 jobs to automate backups.
Hope this helps.
So we do this ... I'm not convinced it is the most elegant method but it works, which is a key starting point I guess.
We have created a device template and labelled it, for want of better wording, "Cisco ASA Multi Context Startup" and a 2nd one for "Running" which is essentially a duplicate of the startup. You cam start with the basic ASA template and work it up from there.
Next step is to edit the template, and here the XML editor is your friend, to add in each of the contexts that you want to download. BTW, once you've created the XML file you can later edit the entries via the interactive wizard if preferred.
Below is an extract from our template, starting at the write erase line as up to there is the same as the base ASA backup.
<Command Name="EraseConfig" Value="write erase${CRLF}Yes" /> <Command Name="SaveConfig" Value="write memory" /> <Command Name="Version" Value="show version" /> <Command Name="ChangeToSystemContext" RegEx="#" Value="changeto system" /> <Command Name="ChangeToContext" RegEx="#" Value="changeto context ${ContextName}" /> <Command Name="ShowInterfaces" Value="show interface ip brief" /> <Command Name="ShowContext" Value="show context" /> <Command Name="ShowMode" Value="show mode" /> <Command Name="System_Startup" Value="more system:running-config" /> <Command Name="Admin_Startup" Value="more disk0:/admin.cfg" /> <Command Name="NAME_OF_YOUR_FIREWALL_HERE_Startup" Value="more disk0:/NAME_OF_CFG_FILE.cfg" />
Take note of:
In node details : config tab you then have a specific download action. You'll have running / startup / and however many of the above you've configured.
We have then created 2 jobs to automate backups.
Hope this helps.
This did the job, thanks!
Fab - where I can I will always help and happy to have been able to do so here.
For some reason I cannot get this to work. It will always error out with "config too short" for the multiple contexts. I copied the existing template and added the few lines at the bottom of your example. I've also tried adding the UseMultipleDownloadCommands option without effect.
I've had to do something like this to get it to work. Needed to do this for all contexts including the admin and system:
<Command Name="NAME_OF_YOUR_FIREWALL_HERE_Startup" Value="changeto system${CRLF}more disk0:/NAME_OF_CFG_FILE.cfg" RegEx="#"/>
I'm running NCM version 2020.2.5 HF1.
Been trying to implement this but not seeing any of the contexts as drop down, is this correct or no?
<Command Name="EraseConfig" Value="write erase${CRLF}Yes"/>
<Command Name="SaveConfig" Value="write memory"/>
<Command Name="Version" Value="show version"/>
<Command Name="ChangeToSystemContext" RegEx="#" Value="changeto system" />
<Command Name="ChangeToSystemContext" RegEx="#" Value="changeto test1" />
<Command Name="ChangeToSystemContext" RegEx="#" Value="changeto test2" />
<Command Name="ChangeToContext" RegEx="#" Value="changeto context ${ContextName}" />
<Command Name="ShowInterfaces" Value="show interface ip brief"/>
<Command Name="ShowContext" Value="show context"/>
<Command Name="ShowMode" Value="show mode"/>
<Command Name="System_Startup" Value="more system:running-config" />
<Command Name="Admin_Startup" Value="more disk0:/admin.cfg" />
<Command Name="myfirewall_Startup" Value="more disk0:/admin.cfg" />
matt_rees, in conjunction with modifying the Device Template you'd also need to create a new Config Type (article here). The new config type needs to match the name of the command you want it to execute in the Device Template, using your Device Template as an example you'd name the config type myfirewall_Startup and when you execute the download from the UI it will execute what you have defined for it in the Device Template which would mean it'll send "mored disk0:/admin.cfg" to the device.
Thanks, I played around with it and now got it working. Good stuff. I was missing exactly that.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.