cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3214
Views
10
Helpful
4
Replies

Prime Infrastructure - Cant create motd banner using Compliance Fix Job

dragon20071
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

superego
Level 1
Level 1

You have to use Multiline Command.  

 

<MLTCMD> banner motd ~
==========================================================================
BANNER Message Here
==========================================================================
~</MLTCMD>

!

end

!

wr mem

!

 

 

Refer to:

 

https://www.cisco.com/c/en/us/support/docs/cloud-systems-management/prime-infrastructure/211574-PI-3-2-Creation-of-User-Defined-CLI-Tem.html

 

Please rate helpful posts***

View solution in original post

4 Replies 4

superego
Level 1
Level 1

You have to use Multiline Command.  

 

<MLTCMD> banner motd ~
==========================================================================
BANNER Message Here
==========================================================================
~</MLTCMD>

!

end

!

wr mem

!

 

 

Refer to:

 

https://www.cisco.com/c/en/us/support/docs/cloud-systems-management/prime-infrastructure/211574-PI-3-2-Creation-of-User-Defined-CLI-Tem.html

 

Please rate helpful posts***

Great!

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! 

Fails in Chrome but success in Explorer....   :-)