This doesn't seem to fix the problem for me, I've tried putting the "^" in several places and it still double spaces the banner. Anyone find a solution for this?
I also had to deploy an extremely long banner and I was having the same issue. I was able to fix the issue by using Command Script Variables. If you insert a carriage return variable instead of using separate lines in the script it should deliver the banner properly. So in your example you can use the following instead:
THIS IS A DOD COMPUTER SYSTEM. BEFORE PROCESSING CLASSIFIED${CRLF}INFORMATION, CHECK THE SECURITY ACCREDITATION LEVEL OF THIS SYSTEM.
The result of which will be the string of text on two separate lines without the double spacing.
Something similar happened to me quite a while back while pushing configuration changes with a terminal emulator. The fix for me was choosing a different emulation (vt52 in this case). If your sending and receiving emulations aren't the same, you could be sending something to your switch that it is interpreting as 2 line feeds instead of a carriage return and a line feed.
I can't even get a login banner to work through NCM.
Okay I take that back... it only takes about 30 seconds per line... so 150 devices... awesome!
EDIT: Okay, changing the Telnet/SSH Prompt Timeout to 5 seconds made each line appear after 5 seconds. Why does it do this? It's a simple paste...
Can you please open a support ticket on this one and reference reproduction steps in your post? We'll need to try to reproduce in house to figure out what's going on.
Hi Chris,
I'm seeing a similar issue while trying to upload a long banner. Even when using Command script variables such as ${CR} and ${CRLF} I still can't get more than a few words per line.
I ran Wire shark to see if I could spot anything with the transmission of the data but nothing obvious popped up. The only thing I saw which may or may not be contributing to the issue is that all the commands are echoed by the device being uploaded to. This is what I would expect to see if I was typing in the commands through a terminal window, but it might not be needed for the way that NCM uploads the data.
To be honest I'm clutching at straws here because I don't really know what's happening. Will I go ahead and raise a ticket as well?
Just a guess here, but perhaps after every CRLF, NCM expects to see a prompt? In a MOTD banner, there is no prompt after a CRLF, so it has to wait for the SSH timeout (which is why lowering the SSH timeout lowered the amount of time I had to wait per banner line).
So perhaps an IOS template issue? I'm not sure how NCM dictates what it expects to get back from the device...
Can the folks having issues with banners post their exact commands scripts they're trying to run in NCM, target device types, and whether you're using SSH or Telnet for script execution? I'd like to try to reproduce myself.
I've noticed that on our Cisco 4507 switch in the lab, it requires delimitting the MOTD banner with a "c" before and "c" after the banner.
So, I ran the following and it worked fine:
${EnterConfigMode}banner motd c THIS IS A DOD COMPUTER SYSTEM. BEFORE PROCESSING CLASSIFIED INFORMATION, CHECK THE SECURITY ACCREDITATION LEVEL OF THIS SYSTEM. cexitexit
Update: Same results on Cisco 3750.
Can the folks having issues with banners post their exact commands scripts they're trying to run in NCM, target device types, and whether you're using SSH or Telnet for script execution? I'd like to try to reproduce myself. I've noticed that on our Cisco 4507 switch in the lab, it requires delimitting the MOTD banner with a "c" before and "c" after the banner.So, I ran the following and it worked fine:${EnterConfigMode}banner motd c THIS IS A DOD COMPUTER SYSTEM. BEFORE PROCESSING CLASSIFIED INFORMATION, CHECK THE SECURITY ACCREDITATION LEVEL OF THIS SYSTEM. cexitexitUpdate: Same results on Cisco 3750.
Chris,
The problem with your banner is that it's all on one line. The problem NCM is having is only when there is a line break with no IOS prompt being returned.
I tried it two ways:
config tbanner motd *-------------W A R N I N G-------------THIS IS A PRIVATE COMPUTER SYSTEM. It is for authorized use only.Disconnect IMMEDIATELY if you are not an authorized user!*endwr
And then:
config tbanner motd *${CRLF}-------------${CRLF}W A R N I N G${CRLF}-------------${CRLF}${CRLF}THIS IS A PRIVATE COMPUTER SYSTEM. It is for authorized use only.${CRLF}${CRLF}Disconnect IMMEDIATELY if you are not an authorized user!${CRLF}*${CRLF}endwr
This is on a Cisco 2950, with the same results on a Cisco 3550, 3650, and 3750.
I also tried with different delimiting characters just in case the asterisk was messing stuff up.
Oh, and I'm using SSH.
that's correct. I tried this on our 3750 in the lab:
${EnterConfigMode}banner motd ^ Warning MessageUse of this system is restricted to authorised users only.Unauthorised access or use is prohibited by law.Violators will be prosecuted.Authorised systems users must comply with the Information Security Policiesand Standards of the institution.Your continued use of this system implies your acceptance of the aboveconditions and of the legal or disciplinary actions which can be takenagainst you if you attempt to gain access without authorisation.^exitexit
It worked fine and gives the results you want, but it took a long time. As you noted, during command script execution, NCM will execute a command and then wait for the prompt before executing the next command.
One thing to note is while this is painfully slow, it works. As mentioned above, you can set your timeout to 5 seconds to speed things up. If you have multiple devices, you should run the execute script through a job (or through the web interface) which will execute the scripts in parallel. If you execute the jobs with the right-click execute script option, the script will execute serially on one device at a time which would take forever.
I'll need to touch base with dev to determine how to address this issue.
I also had to deploy an extremely long banner and I was having the same issue. I was able to fix the issue by using Command Script Variables. If you insert a carriage return variable instead of using separate lines in the script it should deliver the banner properly. So in your example you can use the following instead:THIS IS A DOD COMPUTER SYSTEM. BEFORE PROCESSING CLASSIFIED${CRLF}INFORMATION, CHECK THE SECURITY ACCREDITATION LEVEL OF THIS SYSTEM.The result of which will be the string of text on two separate lines without the double spacing.
Heh... why was this suggested as an answer? It doesn't even mention the source of the problem, let alone a resolution :P
While this does not pertain to your scripting issue, I found that if you use putty rather than that pile of shite known as hyperterminal via serial, it does not exhibit the duplicated line feeds issue.
Both hyperterminal and realterm borked it badly. Don't know why this happens. I suppose it could be an IOS issue, as I tried change cr/lfs to lf's, cr's, etc all to no avail.