When running a pull-config on Cisco Nexus device, only a partial config results, with errors in the session logs such as : Feb 02 12:03:35 -921715824/ssh#1: 10003 : (Unknown command|Invalid input|too long|
The partial config file issue may appear as intermittent, but when it does occur, you will see running and startup config as follows:
Startup config :
and the running config:
And in the session logs you will see:
Feb 02 12:03:35 -921715824/ssh#1: 1001 : ([\(]enable[\)]|^ *(?!set system)[A-Za-z0-9_!@$%^&+|~-]+# *$|^2o-west50961735-as13 *[\(]enable[\)] $) Feb 02 12:03:35 -921715824/ssh#1: 1002 : (> *$|^2o-west50961735-as13 $) Feb 02 12:03:35 -921715824/ssh#1: 10003 : (Unknown command|Invalid input|too long|should be less|Unknown|not installed|[^(transmission speed )]set to auto detect|[^(This feature is )]not supported|auto-sensing)
Environment
VMware Smart Assurance - NCM
Cause
The config is not completing as there is a # in the Message of the Day (motd) preceded by non zero chars, in this case: @#
The combination of chars followed by a # is interpreted per device and by the REGEX defined for a device. In the case of NEXUS devices, this combination is interpreted as a prompt for enable, when it does not get a proper enable command, the process ends, resulting in a partial config.
Resolution
For Cisco Nexus device: Do not use # at the end of a motd, preceded by non space characters, e.g xyz#, &*!# etc.
For all other devices: We know that the combination of non space chars followed by # affect Nexus and could affect other devices as the combination is used for other device REGEX codes. Therefore, it is advised that for any device motd, # is not used at the end when preceded by non-space chars.
Additional Information
It has been observed that the partial config only occurs intermittantly. This is as a result of 2 things
1. the location of the motd in the config file 2. the speed at which the pull config occurs
When a pull config is being done, there is a certain amount of data held in a buffer. When the motd with a char# is read, the contents of the buffer is dumped before the process ends abrubtly. If the motd is close to the end of the config file, it may be able to dump the remainder of the config file so it looks as though it completed. Or same if the process speed is fast at that time (nothing else running), it may get to dump the full contents. Other time, it will only be a partial dump so you get the partial config showing different lines each time.