Skip to main content

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:

  1. 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.

  2. You can clone a pre-defined device template in the NCM device template screen and add firmware upgrade commands to it.

  3. 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.

FieldDescription
CommandSpecify 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.
PromptChoose the prompt that Motadata AIOps should identify after executing the command. This ensures precise execution of the subsequent Prompt Command.
Prompt CommandSelect the specific Prompt Command to be executed in the command prompt after the prompt identified in the previous field.
Result PatternDefine the regex pattern to parse the output of the command and extract specific data required for the upgrade process.
Expected ValueSpecify 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

  1. Enter terminal length 0 in the Command field to prepare the terminal for command execution.
  2. Set a Timeout (ms) of 2000.
  3. Choose # as the Prompt and select No Command from the Prompt Command dropdown.
  4. Add show version as the Command to retrieve the current firmware version.
  5. 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

  1. Enter show version in the Command field to fetch the configuration register information.
  2. Set a Timeout (ms) of 2000.
  3. Choose # as the Prompt and select No Command from the Prompt Command dropdown.
  4. Define the Result Pattern as Configuration register is 0xF and set the Expected Value as Configuration 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

  1. Enter copy flash: tftp: in the Command field to initiate the backup process of the existing firmware image.
  2. Set a Timeout (ms) of 2000.
  3. Choose ]? as the Prompt and select No Command from the Prompt Command dropdown.
  4. Use the macro &[FirmwareDeviceBackupFileName] to specify the backup filename.
  5. 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

  1. Enter copy tftp: flash: in the Command field to begin transferring the new firmware image to the device.
  2. Set a Timeout (ms) of 2000.
  3. Choose ]? as the Prompt and select No Command from the Prompt Command dropdown.
  4. 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)

  1. Enter config terminal in the Command field to access the configuration mode.
  2. Set a Timeout (ms) of 2000.
  3. Choose # as the Prompt and select No Command from the Prompt Command dropdown.
  4. Add no boot system followed by boot system flash &[TransferFileName] to update the boot variable with the new firmware image.
  5. End the command sequence with end.

Step 6: Verify Uploaded Firmware Image Integrity

  1. Enter verify flash:&[TransferFileName] in the Command field to verify the integrity of the uploaded firmware image.
  2. Set a Timeout (ms) of 600000.
  3. 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.