Parameterized configuration in RME

Answered Question
Feb 6th, 2008
User Badges:

Hi,

i am using the paramterized scripting to configure banner motd command in which

name and location of router changes. but when i configure it & login into router it gives all the notice and details in one line while i need attached format. any idea how can i achieve it.



Attachment: 
Correct Answer by Joe Clarke about 9 years 5 months ago

I checked the code, and it looks like parameterized templates and multiline commands are mutually exclusive. I don't see why this was done, and I can't think of a good reason why these two would be exclusive.


I can provide a patch to fix this, but you will need to contact the TAC to get it. Have your engineer contact me directly, and I will send them the patch.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Joe Clarke Wed, 02/06/2008 - 23:20
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Replace NAME with $name and location with $location. Then define your parameter "XML" file:




10.1.1.1



Earth



Joe Clarke Wed, 02/06/2008 - 23:23
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Actually, I think I misunderstood your problem. You have the template, but you're not getting the correct banner. When you define a multi-line command, you need to use the multi-line capability in Netconfig. Basically, you surround your banner with tags:


banner motd ...

...


See http://server/help/rme/fundamentals/netcfg_MultilineCmds.html in the RME online help for more details.

roger.malik Wed, 02/06/2008 - 23:43
User Badges:

Hi clarke


Can I use in Template? if yes whre i need to put in


thanks a lot

Joe Clarke Wed, 02/06/2008 - 23:46
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Yes, you can use it in a template. You surround your banner command in the textarea with the tags. Just take your existing template, and surround the whole banner command with .

roger.malik Wed, 02/06/2008 - 23:58
User Badges:

Please check if this is correct.


banner motd ^c line ^c



if this correct then how can i fetch it form netconfig job, since no parameter is passed, if suggest if it wrong.

Joe Clarke Thu, 02/07/2008 - 00:00
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

No. Your template within the Netconfig GUI should be:


banner motd "------------------------------------------------------------------------


$name: $location

------------------------------------------------------------------------


NOTICE: This is a private network device. If you are not authorized


to connect or configure this device, disconnect at once! Actual


or attempted use, access, examination, or configuration change by an


unauthorized person will result in criminal and civil


prosecution to the full extent of the law."


Then, your parameter "XML" file should be similar to the one I provided in my first post.

roger.malik Thu, 02/07/2008 - 00:40
User Badges:

Hi Clarke,

i did try that but banner is not changing though it says job is successful

i fetch bannerscript file from user defined job and then fetch XML file in job. both th e file are attached.

kindly suggest



roger.malik Thu, 02/07/2008 - 01:59
User Badges:

hey clarke any ideas on this, i am not get desir result tried serveral time now.

Joe Clarke Thu, 02/07/2008 - 08:02
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

This looks okay. I need to see a screenshot of your user-defined template within the Netconfig UI.

roger.malik Thu, 02/07/2008 - 19:20
User Badges:

sorry for late response clarke as i was out of shift, iam attaching you screenshot of user define template.



Attachment: 
roger.malik Thu, 02/07/2008 - 20:57
User Badges:

Hi Clarke,


please ignore my previous post, i am attaching screen again.

point to add from my side is when i put "^c"

as delimiter my job after doen't get save however when i put doublecolon (") as delimiter it get saves but doesnot change the banner on router.

its stranged behaviour, can you please look into it.





Attachment: 
Joe Clarke Thu, 02/07/2008 - 21:57
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

^C will not work. You should use double quotes as the delimiter. to troubleshoot why the deployment is not working, you can get a sniffer trace (if using telnet, TFTP, or RCP to deploy the config) or enable RME Config Job debugging, then look at the job log for the deployment job ID.

Joe Clarke Thu, 02/07/2008 - 22:43
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

This isn't the log, or debug wasn't properly enabled. All of the information pertaining to the job will be found under NMSROOT\files\rme\jobs\NetconfigJob\JOBID.

Correct Answer
Joe Clarke Thu, 02/07/2008 - 23:12
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

I checked the code, and it looks like parameterized templates and multiline commands are mutually exclusive. I don't see why this was done, and I can't think of a good reason why these two would be exclusive.


I can provide a patch to fix this, but you will need to contact the TAC to get it. Have your engineer contact me directly, and I will send them the patch.

Joe Clarke Thu, 02/07/2008 - 23:20
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Actually, I think a workaround would be easier, and quicker. This will involve you putting the bulk of the banner in the parameter "XML" file. Your template will become:


banner motd "$bannertext"


Your "XML" file will become:





------------------------------------------------------------------------

NAME: RLG-2811-ANA-1-1 Anaheim,CA

------------------------------------------------------------------------

NOTICE: This is a private network device. If you are not authorized

to connect or configure this device, disconnect at once! Actual

or attempted use, access, examination, or configuration change by an

unauthorized person will result in criminal and civil

prosecution to the full extent of the law.




roger.malik Fri, 02/08/2008 - 00:00
User Badges:

workaround is not working. i think it actually dont like the space between and .

after running this, banner its not in exact sequence and appear in one line in router.

i will ask to raise the TAC with cisco and inform them to directly call you so that we can get patch for it.

thanks again clarke for the same. thanks a ton,

roger.malik Fri, 02/08/2008 - 00:39
User Badges:

Hey Clarke,


i open TAC now. i think they assidged the ticket to you directly.

roger.malik Sun, 02/17/2008 - 19:10
User Badges:

finally this is done. thanks to eguener and joe for awesome effort.

Actions

This Discussion