cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2359
Views
5
Helpful
3
Replies

CLI Templates in Prime

scott.leonard
Level 1
Level 1

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

2 Accepted Solutions

Accepted Solutions

Marvin Rhoads
Hall of Fame
Hall of Fame

I'm not sure about the efficacy of your suggestion; but I have had success adding the line:

do copy running-config startup-config

 

View solution in original post

do copy running-config startup-config

produces the error:

copy not allowed in config mode or submode

so instead I used:

do wr

View solution in original post

3 Replies 3

Marvin Rhoads
Hall of Fame
Hall of Fame

I'm not sure about the efficacy of your suggestion; but I have had success adding the line:

do copy running-config startup-config

 

do copy running-config startup-config

produces the error:

copy not allowed in config mode or submode

so instead I used:

do wr

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.