11-25-2014 07:50 AM
HI,
We are trying to leverage PI 2.1 to push "mtu jumbo 9000" to several hundred of our switches (2960 (G,S & X models), 3750 models, as part of a large MTU project. We can't seem to find this function in the template library. We are struggling with using Velocity Template Language (VTL) to author such command. We are unfamiliar with this language. It is not in the manual from the official Cisco PINFRA training class we just took.
Anyone out there know what I am talking about?
Thanks,
Chad
11-25-2014 09:28 AM
Just use the basic cli template and send the one command you need to the devices that need it.
11-25-2014 09:41 AM
Thanks Marvin, you are always so fast and helpful on this forum! I'll let Mike on my team try this and report back!
11-25-2014 12:58 PM
Marvin
Using the basic cli template and a single command to a single switch worked. However I need to run a couple of commands to multiple switches like;
1) system mtu jumbo 9000
2) copy running-config startup-config
3) reload
Thanks
Mike
11-25-2014 02:06 PM
A cli template can be comprised of multiple commands.
You only need to use the VTL scripting if you want to get fancy and use forms etc.
11-25-2014 02:59 PM
I have been unsuccessful thus far. I will continue to read and peck away at getting multiple commands i.e. configuration and enable commands to work together in the same cli template.
11-25-2014 06:49 PM
Here's a cli template (sanitized a bit) I have in place on a network. Remember your commands are config-mode so anything that you need to execute in enable mode needs to be prepended with "do".
service sequence-numbers
!
logging host 10.0.*.*
!
snmp-server host 10.0.*.* ****private
!
no ip ssh logging events
!
errdisable recovery cause all
!
udld enable
!
do copy running-config startup-config
It works very nicely. and you should be able to lay out any arbitrary set of valid commands similarly. I have set validation criteria to only allow it to go to devices for which these are valid commands (although you could easily choose only valid devices during the deployment process).
11-26-2014 07:19 AM
Mike,
Something else that can be done is to set up composite templates for multiple commands to be run. With composite templates, Prime still somewhat "acts" like it is driving out each command separately, but it will help free you up from either:
1. running multiple jobs to get your configs rolled out
2. free you up from having to employ using some of the Apache VTL scripting
Although, in referencing this particular link of PI documentation, they do show some helpful syntax on how to script multi-line configs.
http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/2-0/user/guide/prime_infra_ug/create_temps.html#31705
Here is a sample that I extracted from some of Cisco's docs using VTL.
#MODE_ENABLE
write memory
#MODE_END_ENABLE
here is a sample of employing banner messages using the multi-line command:
<MLTCMD>banner login ^C
enter applicable text here...
^C</MLTCMD>
<MLTCMD>banner motd ^C
enter applicaple text here...
^C</MLTCMD>
<MLTCMD>banner exec ^C
Enter applicaple text here... -
^C</MLTCMD>
HTH....
Regards,
Brandon
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