12-04-2014 09:52 AM
I'm learning how to create CLI templates and have an easy question.
A few weeks ago a created a very simple template that configured a logging server (Prime). It had two lines:
logging facility syslog
logging xxx.xxx.xxx.xxx (IP of my Prime server)
I wasn't sure if I needed to use the command 'configure terminal' or not and left it out. It turns out that Prime is smart enough to enter configure mode before running the commands but it did not write the new configuration and left all the switches with a mismatch between Run and Start.
I'm now writing another simple template and don't know how to put in the write command. Do I just put that after some configure mode commands and trust that Prime is smart enough to exit configure mode before executing 'write' or should I explicitly put an 'exit' before 'write' ?
This?:
no logging event link-status
write
or this?:
no logging event link-status
exit
write
Solved! Go to Solution.
12-04-2014 03:12 PM
I'm not sure about the efficacy of your suggestion; but I have had success adding the line:
do copy running-config startup-config
12-05-2014 02:47 PM
do copy running-config startup-config
produces the error:
copy not allowed in config mode or submode
so instead I used:
do wr
12-04-2014 03:12 PM
I'm not sure about the efficacy of your suggestion; but I have had success adding the line:
do copy running-config startup-config
12-05-2014 02:47 PM
do copy running-config startup-config
produces the error:
copy not allowed in config mode or submode
so instead I used:
do wr
12-05-2014 03:17 PM
Thanks for the update - it looks like some versions indeed don't allow the copy command in config mode - I just verified on another switch.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide