Network Management
NCM script to push a banner change takes a while to execute
Some mechanics of a Banner Command and NCM logic that conflicts and caused a lot of overhead creating slow performance or hangs the application or even the server. In order to alleviate this pressure, add a couple of macros to the script to temporarily bypass some NCM logic and increase efficiency
First published date
Last published date
Overview
Product section
Cause
Resolution
- In the execute command script, on the line after the
conf tcommand is issued add the macro:
${DisablePromptDetection}
- After the last deliminator in the banner is written, drop down a line and add the macro:
${EnablePromptDetection}
Example:
conf t
${DisablePromptDetection}
banner motd ^C
PLEASE DO NOT CHANGE THE HOSTNAME OF THIS DEVICE
OR CHANGE USERNAMES AND PASSWORDS!
^C
${EnablePromptDetection}
end
It is crucial after the ${DisablePromptDetection}macro is issued one does not neglect to have the ${EnablePromptDetection} back to turn it back on.
To use this option in the config change template the template needs to have the following commands added:
string @disablePromptDetection = '${DisablePromptDetection}'
string @enablePromptDetection = '${EnablePromptDetection}'
Then @disablePromptDetection is used in the command where one would need to disable the prompt detection.
Example:
script ChangeMOTDBannerCiscoIOS (
NCM.Nodes @ContextNode,
string @MOTDBanner )
{
string @disablePromptDetection = '${DisablePromptDetection}'
string @enablePromptDetection = '${EnablePromptDetection}'
CLI
{
configure terminal
@disablePromptDetection
no banner motd
banner login C@MOTDBanner C
@enablePromptDetection
end
}
}