Welcome to Netcordia Connection Sign in | Join | Help
in Search

How to set a banner on Cisco devices with NetMRI CCS

Last post 07-16-2008 2:28 PM by fblank. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-13-2008 5:30 AM

    How to set a banner on Cisco devices with NetMRI CCS

    Hi,

    I have a simple question as to how to set a banner on a Cisco device using a CCS script. I would like to do this on a number of devices out of compliance reasons.

    The script works fine up until the first time it doesn't get the normal IOS prompt back and ends with a timeout error. Is there any way to do this simple task with NetMRI?

    Here is the script:

    Script:
     SetBanner.ccs - set banner (login and exec)

    Script-Description:
     This script sets the required banner for both login and
     exec in the device.
    #-----------------------------------------------------------------------
    # The Script-Filter is used to indicate that the entire script
    # should only be executed for Cisco IOS devices.
    #-----------------------------------------------------------------------
    Script-Filter:
     $Vendor eq "Cisco" and $sysDescr like /IOS/

    ########################################################################
    Action:
     SetBanner

    Action-Description:
     This action is executed once for every device that matches the
     Script-Filter defined above.  It first deletes the current login & exec banner
     (if there at all) and then sets a login and exec banner
     and saves the configuration.

    Action-Commands:
     terminal length 512
     config terminal
     no banner exec
     no banner login
     banner exec #
     *************************************************
     *   UNAUTHORIZED ACCESS STRICTLY PROHIBITED     *
     *  bla bla bla                                  *
     *************************************************
     #
     banner login #
     *********************************************
     *                                           *
     *  UNAUTHORIZED ACCESS STRICTLY PROHIBITED  *
     *                                           *
     *********************************************
     #
     exit
     write memory
    ########################################################################

    output of the processlog

    11:15:53   Action-Commands  
     
    11:15:54 
       terminal length 512 
     
    11:15:54 
       config terminal 
     
    11:15:54 
       no banner exec 
     
    11:15:55 
       no banner login 
     
    11:15:55 
       banner exec # 
     
    11:15:56 
       ************************************************* 
     
    11:16:57 
     

    *** Timeout waiting for device *** testRouter1(config)#no banner exec 
     testRouter1(config)#no banner login 
     testRouter1(config)#banner exec # 
     Enter TEXT message.  End with the character '#'. 
     ************************************************* 

  • 07-14-2008 9:53 AM In reply to

    Re: How to set a banner on Cisco devices with NetMRI CCS

    In order to set the banner using the ccs script, you will need to add a carriage return to the end of each line so that the whole string is entered at once.  This needs to be done since the ccs script is expecting a prompt before sending the next command, but the cisco enters an editor type of session where it expects the escape character before returning to the prompt.   Here is an example of accomplishing this:

     

    conf t
    banner login X \cm****************************************************************************\cm \cm This is a private computer system, which may be accessed and used only by \cm authorized personnel. \cm \cm****************************************************************************\cm X\cm

    end
    wri

    Note: The banner login line all the way to the X\cm is 1 line

    Output:

     
    QAdynrtr1022#enable
    QAdynrtr1022#terminal no monitor
    QAdynrtr1022#terminal length 24
    QAdynrtr1022#terminal no editing
    QAdynrtr1022#conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    QAdynrtr1022(config)#banner login X
    Enter TEXT message.  End with the character 'X'.

    ****************************************************************************

     This is a private computer system, which may be accessed and used only by
     authorized personnel.

    ****************************************************************************
     X

    QAdynrtr1022(config)#
    QAdynrtr1022(config)#end
    QAdynrtr1022#wri

    Building configuration...

    [OK]

    QAdynrtr1022#

     

    Shawn

     

  • 07-16-2008 2:28 PM In reply to

    Re: How to set a banner on Cisco devices with NetMRI CCS

    Hi Shawn,

    Thank you very much for your help. I did try to create one line with the carriage returns, but I did that right after the "banner login" line, not on the same one. Thanks again!

    Franco

Page 1 of 1 (3 items)