Adding Firmware Upgrade Commands to a Device Template
Motadata AIOps allows administrators to define firmware upgrade command sequences within an associated NCCM device template. These commands control how the firmware upgrade is executed on a network device and ensure that the required pre-checks, transfers, and validations are performed in the correct order.
The firmware upgrade workflow is fully driven by the commands configured in the template. Once defined, these commands are used by NCCM to execute firmware upgrades in a controlled and repeatable manner.
You can add firmware upgrade commands to an NCCM device template in any of the following situations:
While creating a new NCCM device template. Go to Menu. Select Settings
. After that, select Network Config Settings
. Select Device Template and then select Create Template to create a custom template.
By cloning a pre-defined device template from the NCCM Device Template screen and adding the required firmware upgrade commands.
By updating an already created custom NCCM device template.
Firmware Upgrade Commands Screen
This screen allows administrators to define the commands required for firmware upgrade on supported devices. These commands are executed in sequence and can include validation logic to ensure that each step completes successfully before the next one begins.
| Field | Description |
|---|---|
| Command | Specify the command to be executed during the firmware upgrade process. This customization allows you to tailor the firmware upgrade sequence to the specific requirements of your network device. |
| Timeout (ms) | Define the time Motadata AIOps should wait to receive output after command execution. The operation will timeout if no output is received within the specified time. |
| Prompt | Choose the prompt that Motadata AIOps should identify after executing the command. This ensures precise execution of the subsequent Prompt Command. |
| Prompt Command | Select the specific Prompt Command to be executed in the command prompt after the prompt identified in the previous field. |
| Result Pattern | Define the regex pattern to parse the output of the command and extract specific data required for the upgrade process. |
| Expected Value | Specify the expected value that the command output should match. This field is used to validate the output against the expected result, ensuring the command executed successfully before proceeding to the next step. If the output does not match the expected value, the process can be flagged for review or correction. |
After defining the initial firmware upgrade commands, you can continue adding commands for related operations such as retrieving the current firmware image, checking available space, backing up the existing image, transferring the new image, updating the boot variable, and validating the uploaded firmware file.
Example: Firmware Upgrade for a Cisco Device
Consider a scenario where you need to upgrade the firmware of a Cisco device using a specific command sequence.
Step 1: Get Current Firmware Image
- Enter
terminal length 0in the Command field to prepare the terminal for command execution. - Set a Timeout (ms) of
2000. - Choose
#as the Prompt and select No Command from the Prompt Command dropdown. - Add
show versionas the Command to retrieve the current firmware version. - Define the Result Pattern as
System\s+image\s+file\s+is\s+\"\S+\:(\S+)"to extract the current firmware image file.
Step 2: Get Configuration Register Info
- Enter
show versionin the Command field to retrieve the configuration register information. - Set a Timeout (ms) of
2000. - Choose
#as the Prompt and select No Command from the Prompt Command dropdown. - Define the Result Pattern as
Configuration register is 0xFand set the Expected Value asConfiguration register is 0xF.
Get Free Space
- Command:
dir flash: - Timeout (ms):
2000 - Prompt:
# - Prompt Command:
No Command - Result Pattern:
\d+\s*bytes\s*total\s*\((\d+)\s+bytes\s*free\)
This command checks the available free space on the device to ensure that sufficient storage is available for the new firmware image.
Step 3: Backup Existing Firmware Image
- Enter
copy flash: tftp:in the Command field to start backing up the existing firmware image. - Set a Timeout (ms) of
2000. - Choose
]?as the Prompt and select No Command from the Prompt Command dropdown. - Use the macro
&[FirmwareDeviceBackupFileName]to specify the backup file name. - Continue adding the required commands to complete the backup operation, including the TFTP server address and destination file name.
Step 4: Transfer Firmware Image to Device
- Enter
copy tftp: flash:in the Command field to begin transferring the new firmware image to the device. - Set a Timeout (ms) of
2000. - Choose
]?as the Prompt and select No Command from the Prompt Command dropdown. - Use the macros
&[TransferProtocolServerAddress]and&[TransferFileName]to specify the TFTP server address and firmware file name.
Step 5: Update Boot Variable (Mount)
- Enter
config terminalin the Command field to enter configuration mode. - Set a Timeout (ms) of
2000. - Choose
#as the Prompt and select No Command from the Prompt Command dropdown. - Add
no boot systemfollowed byboot system flash &[TransferFileName]to update the boot variable with the new firmware image. - End the sequence with
end.
Step 6: Verify Uploaded Firmware Image Integrity
- Enter
verify flash:&[TransferFileName]in the Command field to verify the integrity of the uploaded firmware image. - Set a Timeout (ms) of
600000. - Choose
#as the Prompt and select No Command from the Prompt Command dropdown.
By configuring these commands in sequence, administrators can define a complete firmware upgrade workflow for Cisco devices. Similar logic can be applied to other devices by updating the command sequence based on vendor-specific firmware upgrade requirements.