Adding commands to profiles using the CLI

Prev Next

Use the commands in this section to add commands to a profile.

To add individual commands to a profile:
  1. Enable the CLI configuration mode.

    hostname > enable
    hostname # configure terminal
  2. Add a command and specify its sequence:

    hostname (config) # cmc profile <profileName> command <sequenceNumber> "<command>"

    where:

    • profileName is the name of an existing or new profile. (If the profile does not exist, it will be created.)

    • sequenceNumber is an integer that controls the order in which the commands within the profile will be executed. The command with the smallest sequence number is executed first.

    • command is the CLI command. It must be enclosed in double quotation marks.

  3. Repeat the previous step for each command you want to include.

  4. Verify your changes:

    hostname (config) # show cmc profiles <profileName>
  5. Save your changes:

    hostname (config) # write memory

To extract commands from a running configuration and add them to a profile:

Important

Some commands in the running configuration may be incompatible with a different product type or appliance model. Review the commands to determine if they are compatible before you apply a profile using this command.

  1. Enable the CLI configuration mode:

    hostname > enable
    hostname # configure terminal
  2. Specify the empty profile and the appliance from which to extract the commands:

    hostname (config) # cmc profile <profileName> extract-from-appliance <applianceName>

    where profileName is the name of an empty profile, and applianceName is the name of the appliance from which the commands from the running configuration will be extracted.

  3. Verify your change:

    hostname (config) # show cmc profiles <profileName>
  4. Save your change:

    hostname (config) # write memory
To copy a profile:
  1. Enable the CLI configuration mode:

    hostname > enable
    hostname # configure terminal
  2. Specify the names of the source profile and the target (new) profile:

    hostname (config) # cmc profile <sourceProfileName> copy <targetProfileName>

    where sourceProfileName is the original profile and targetProfileName is the new profile.

  3. Verify your change:

    hostname (config) # show cmc profiles
  4. Save your change:

    hostname (config) # write memory

Examples

Manually adding commands

This example populates the "acctmgt" profile with commands that will add an Operator3 user account to the appliances to which it is applied.

hostname (config) # cmc profile acctmgt command 1 "username Operator3 role operator"
hostname (config) # cmc profile acctmgt command 2 "username Operator3 password evtk*643U"

hostname (config) # show cmc profiles acctmgt
Profile acctmgt
   Comment:
   Commands: 
      1. username Operator3 role operator
      2. username Operator 3 password evtk*643U
Adding commands extracted from the configuration of another appliance

This example extracts commands from the EX-03 appliance running configuration, populates the "general" profile with them, and applies them to the EX-05 appliance. The output indicates that the no fenet check-certificate command could not be executed.

hostname (config) # cmc profile extract extract-from appliance EX-03
hostname (config) # cmc profile general apply appliance EX-05 
 
====================Appliance EX-05==========================

Execution was successful.

Execution output:

%Disabling certificate checking is not allowed.

Saving configuration file...Done!