Overview of command sets

Use this information to acquire an understanding of command sets.

Command sets can be parameterized so that some values can be modified at run time. Command sets are defined on a specific VTMOS, and it is important to ensure that all commands included in the command set apply to the VTMOS chosen.

Command sets are applied as a unit of work (UOW), and therefore can be scheduled and approved.
Note: When creating a modeled command set, the list of VTMOS labels from which you can select has been filtered to only display the labels for Smart Model drivers. Standard driver VTMOS are excluded.
An example of the use of command sets is a network administrator wanting to change the SNMP contact of all the Cisco 26xx routers on the network to the same value, without having to create individual configuration change UOWs for each resource.

About command sets

Native command sets
Native command sets allow you to send CLI commands to one or more network resource at a time. The information from these commands is shown in the UOW log.
Native command sets can be used to modify commands on both managed and modeled network resources, and can be scheduled like any other UOW.
Native command sets include two modes of operation:
Configuration change
Used to change the configuration on a network resource.
Interrogation
Used to issue informational requests, such as show diag or show version.
When a native command set contains a script that attempts to send a restricted command via the device interface, it will be rejected when the script attempts to execute.
Note: This apples to interrogation command sets only, and not to configuration change command sets.
Realms and security
In order to create and apply command sets, you must belong to a group with the appropriate access privileges. A command set can be created in any realm, and can then be applied to network resources in any other realm, as long as appropriate rights for each realm are allocated.
Using command sets as default configurations
Command sets are ideally suited for use as default configurations to seed new resources. For example, if there are many resources of the same VTMOS, a parameterized template could be created using a command set that would be applied to each resource, thus saving time on manually configuring each device.
A second common application for command sets is to apply identical configuration stanzas to multiple devices, for example to apply login banners, manage VLANs and trunks, or manage SNMP settings.
Wildcards
For modeled command sets, wildcards are supported in command set elements, allowing a comparison to be made against any previous value, thus making command sets more general and reusable.
Parameters
Parameters allow the reuse of command sets, as each time the command set is applied, the value of the parameterized value can be defined. A default value may be used for any parameterized field. The user applying the command set is prompted to provide values for any parameterized fields.
Failures
A UOW task is considered a failure when a command set does not execute successfully against a resource. If there are multiple modifications within a command set, and one change in the command set fails, the application of the command set to that particular network resource is stopped.
When a command set is being applied, the number of failures allowed before the UOW containing the command set(s) should stop processing may be specified. This is specified in the Configure Execution Options display window.
If a modeled command set does not make a change to a configuration, this does not necessarily mean a failure has occurred. The command set may have been designed to change a configuration if the criteria matches. Or the command set may only change a value based on the current value. For example a command set may state that banner/motd will be changed to “new message” only if the current value is “test message.”
Native command sets, however, will simply execute the commands, and the device will merge or modify the commands in the way one would expect when entering them on the CLI.
After any configuration change failure, Netcool Configuration Manager uses the value of the ResourceErrorRecovery flag to determine how to roll back the change.
Multiple command sets
Multiple command sets can be applied to a network resource at the same time.
The same command set can also be added multiple times to the same UOW, which means the same command set will be applied to each network resource specified in the UOW multiple times. This is particularly useful when adding list commands, because a single command set that adds a parameterized list command can be created. Examples would be when adding NTP servers or SYSLOG servers.
Multiple command sets may be applied to a single resource or to multiple resources. Take into account any dependencies when the command sets and resources are being ordered.

Modeled command set processing

Use this information to learn how a modeled command set is processed, from submission to completed UOW.
Note: A device must be in synch before applying a command set.
Parameter substitution
When a command set is submitted, XML representing the command set logic is added to the UOW. If any parameterized values existed in the command set, those parameters are replaced by their actual values (supplied by the user submitting/applying the command set).
Device processing
Before applying a command set to the configuration running on a resource, the command set is applied to a copy of the current configuration in the database. Each configuration change (add, delete, match/replace, and so forth) within the command set is examined to determine if the requested change can be made. If the command set results in any changes, the copy of the current configuration is saved as a draft configuration. If no changes would result from the application of the command set, the next work component is processed, or if that was the only work component, the UOW is shown as completed with a successful status.
Before applying the draft configuration to the device, the system compares running versus stored (the two versions of the configuration on the network resource), and running versus current (the copy stored in the database). If any differences are found, the application of that command set to that resource is considered a failure.
If the comparisons are the same, the draft configuration that was created at the beginning of processing is applied to the network resource, and the “old” current configuration becomes a versioned configuration. The “new” current configuration is named “application of command set x” where x is the name of the command set that was just applied.
This process continues for each work component contained within the UOW. See the following section for a description of how work components are ordered within a command set UOW.
Work processing order
When multiple command sets are applied against multiple network resources, there are two different ways in which the command sets can be applied to the device. These are 'Apply Device at a time', and 'Apply Command Set at a time'.
Apply Device at a time
If this option is chosen each and every command set will be applied to the first resource. Only when each command set has been applied, will the command sets then be applied to the next resource. The following table shows the order in which individual work components are processed when multiple command sets are applied to multiple network resources.
Table 1. Work component processing order when multiple command sets are applied to multiple network resources
Command set Resource 1 Resource 2
Command Set 1
  • config chg A
  • config chg B

1. Command set 1, change A is applied to Resource 1.

2. Command set 1, change B is applied to Resource 1.

5. Command set 1, change A is applied to Resource 2.

6. Command set 1, change B is applied to Resource 2.

Command Set 2
  • config chg A
  • config chg B

3. Command set 2, change A is applied to Resource 1.

4. Command set 2, change B is applied to Resource 1.

7. Command set 2, change A is applied to Resource 2.

8. Command set 2, change B is applied to Resource 2.

Apply command set at a time
This option represents the processing order in case a UOW is submitted "Command Set at the time", in which case the first command set is executed against all devices before a second command set is executed against all devices, and so on. The following table shows the order in which individual work components are processed when multiple command sets are applied to multiple network resources.
Table 2. Work component processing order when multiple command sets are applied to multiple network resources
  Command Set 1
  • config chg A
  • config chg B
Command Set 2
  • config chg A
  • config chg B
Resource 1

1. Command set 1, change A is applied to Resource 1.

2. Command set 1, change B is applied to Resource 1.

5. Command set 2, change A is applied to Resource 1.

6. Command set 2, change B is applied to Resource 1.

Resource 2

3. Command set 1, change A is applied to Resource 2.

4. Command set 1, change B is applied to Resource 2.

7. Command set 2, change A is applied to Resource 2.

8. Command set 2, change B is applied to Resource 2.

Note: Each work component represents a unique resource change, in which the device is locked, the change is made, the old ’current becomes a versioned configuration, and a new current configuration is created.