Adding Firmware Upgrade Commands to a Device Template
Motadata AIOps provides a comprehensive solution for managing firmware upgrades on network devices. This feature enables you to define and execute a sequence of commands necessary to upgrade a device's firmware, ensuring enhanced performance and security. The commands are configured within the associated NCM device template, which dictates the entire firmware upgrade process. Below, we outline the steps involved in configuring firmware upgrade commands, followed by an example specific to upgrading the firmware of a Cisco device.
You can add firmware upgrade commands to a NCM device template in any of the following situations:
When you create a new NCM device template . Go to Menu. Select Settings . After that, select Network Config Settings . Select Device Template and then select Create Template button to create a custom template.
You can clone a pre-defined device template in the NCM device template screen and add firmware upgrade commands to it.
You can add the firmware upgrade commands to an already created custom NCM device template.
Firmware Upgrade Commands Screen
This screen allows administrators to define the commands necessary for upgrading the firmware on specific network devices. The fields available on this screen ensure that every aspect of the firmware upgrade process is carefully managed.
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 specifying the initial firmware upgrade commands, administrators can add commands for additional operations such as getting the current firmware image, verifying the available free space, or backing up the existing firmware image. Below is an example illustrating the configuration of firmware upgrade commands for a Cisco device.
Example: Firmware Upgrade for a Cisco Device
Consider a scenario where you need to upgrade the firmware of a Cisco device using a specific sequence of commands.
Step 1: Get Current Firmware Image
- Enter
terminal length 0
in 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 version
as 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 version
in the Command field to fetch 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 0xF
and 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 sufficient storage for the new firmware image.
Step 3: Backup Existing Firmware Image
- Enter
copy flash: tftp:
in the Command field to initiate the backup process of 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 filename. - Continue adding the commands required to complete the backup process, including specifying the TFTP server address and the 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 and file name for the new firmware image.
Step 5: Update Boot Variable (Mount)
- Enter
config terminal
in the Command field to access the configuration mode. - Set a Timeout (ms) of
2000
. - Choose
#
as the Prompt and select No Command from the Prompt Command dropdown. - Add
no boot system
followed byboot system flash &[TransferFileName]
to update the boot variable with the new firmware image. - End the command 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 following these steps, you can successfully configure the firmware upgrade commands for a Cisco device. This is just one example; similar steps can be followed for other devices by customizing the commands as per their requirements.