11-14-2018 12:22 AM - edited 11-14-2018 12:24 AM
Hi. I created a compliance policy that need to check configured login or motd banner exist on a switch.
When my audit job has stopped and i got some devices with violation failure, i have to start a fix job with preconfigured cli command.
Fix cli looks like this:
banner motd #
====================================================================
Authorized Access Only!
Attention! Youre connecting to private computer system.
All access and actions are logged!
If youre not an authorized person, please disconnect immediately!
====================================================================
#
do write memory
But in the end of fix job i constantly got a failure with that message:
"Error : Connection timed out while executing the command
Current output : banner motd #Enter TEXT message. End with the character '#'.
Current expects : (2002-asw-1.{0,30}|2002-asw-1.boaz)([^)]+)#s*z2002-asw-1.boaz#s*z[y/n]ACCEPT? (yes/[no]): "
2002-asw-1.boaz its a hostname of my switch
What exactly switch expects in cli according to this error? Some regular expression?
Solved! Go to Solution.
11-14-2018 12:23 PM
You have to use Multiline Command.
<MLTCMD> banner motd ~
==========================================================================
BANNER Message Here
==========================================================================
~</MLTCMD>
!
end
!
wr mem
!
Refer to:
Please rate helpful posts***
11-14-2018 12:23 PM
You have to use Multiline Command.
<MLTCMD> banner motd ~
==========================================================================
BANNER Message Here
==========================================================================
~</MLTCMD>
!
end
!
wr mem
!
Refer to:
Please rate helpful posts***
11-14-2018 08:59 PM
05-14-2020 04:12 AM
Hi!
Helped me out too! Thanks!
Now I would like to add a variable in the banner with dynamic hostname and domain upon login, by adding $(hostname).$(domain). And this actually works in the template and pushing it to the switches, but the job in Prime turns red, with this error:
Error : Connnection timed out while executing the command Current output : switchname10#Current expects : switchname1.{0,30}([^)]+)#s*zYou are entering device #s*z |
Here is the complete banner:
<MLTCMD> banner login ~
Property of Company X
Authorized access only!
****************************************************************
You are entering device >>> $(hostname).$(domain)
****************************************************************
~</MLTCMD>
And the switch hostname is, switchname10
Thanks for any input!
05-14-2020 06:04 AM
Fails in Chrome but success in Explorer.... :-)
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