Submit a ticketCall us

Quickly Address Software Vulnerabilities
Patch Manager is an intuitive patch management software which extends the capabilities of WSUS and SCCM to not only patch Windows® servers and workstations, and Microsoft® applications, but also other 3rd-party applications which are commonly exploited by hackers. Learn more about our patch management solution.

 

Home > Success Center > Network Configuration Manager (NCM) > NCM Script to push a Banner Change takes a while to execute

NCM Script to push a Banner Change takes a while to execute

Created by Bill Corgey, last modified by Bill Corgey on Oct 18, 2016

Views: 60 Votes: 1 Revisions: 6

Overview

In short, there are 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, we can add a couple of Macros to the script to temporarily bypass some NCM logic and effectively increase efficiency

Environment

NCM version 6.1 or later

Cause 

When NCM issues a command, it needs to examine each blob that is returned to check if the prompt has been returned to know what the next course of action it should take. In the case of how the banner command is, the entire banner is processed with a few characters at a time.  This creates a delay as NCM has to process the logic that could take 3 seconds or more very frequently

Resolution

  1. In the execute command script, on the line after the conf t command is issued add the macro:
    ${DisablePromptDetection}
  2. 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 this added

string @disablePromptDetection = '${DisablePromptDetection}'
string @enablePromptDetection = '${EnablePromptDetection}'

 

 

then @disablePromptDetection 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
  }


}

 

____________________________________________________________

 

 

 

Last modified
11:10, 18 Oct 2016

Tags

Classifications

Public