Macros and Prompt Commands for Custom Template
Introduction to Macros in NCCM Device Template
Macros in Motadata AIOps act as dynamic placeholders that are replaced with actual values during execution. They enable administrators to create reusable and flexible templates without hardcoding values for each device.
These macros are commonly used in NCCM device templates while defining commands for configuration backup, restore, synchronization, and file transfer operations. By using macros, administrators can standardize template behavior while allowing runtime values such as server address, file name, or credentials to be dynamically injected.
Using macros ensures that templates remain adaptable across multiple devices and environments, reducing manual effort and improving consistency in configuration management workflows.
Below is an overview of the commonly used macros available in Motadata AIOps.
Key Macros and their Functions
| Macros | Description |
|---|---|
| &[Enter] | This macro represents the Enter key or newline character ("\n"). It is essential for simulating the press of the Enter key, which is often required for navigating command-line interfaces and executing commands. |
| &[TransferFilePath] | This macro represents the file path used during file transfer operations. It is particularly useful when specifying the location of files being transferred within the platform. |
| &[TransferProtocolServerAddress] | This macro denotes the server address or host used during transfer protocol operations. It specifies the destination address for file transfers, allowing users to dynamically configure the server address. |
| &[TransferProtocolServerUser] | This macro denotes the user account used during transfer protocol operations. This macro is used to specify the user credentials required to authenticate and perform file transfers to or from the server. |
| &[TransferProtocolServerPassword] | This macro denotes the user password employed during transfer protocol operations. This macro is utilized to provide the necessary password for authentication when transferring files to or from the server. |
| &[TransferFileName] | This macro denotes the unique filename assigned during file upload operations. When interacting with external systems or transferring files, this macro represents the specific name assigned to the file being uploaded. |
| &[ConfigModePassword] | This macro represents the password required to access configuration mode. It is particularly useful when configuring devices with specific password protection, ensuring secure access to configuration settings. |
| &[VRFName] | This macro represents the name of the Virtual Routing and Forwarding (VRF) instance. It is used in configurations where devices support VRF, allowing users to dynamically specify the VRF name during template creation or configuration management. |
These macros provide a standardized way to handle dynamic inputs during command execution, enabling scalable and consistent NCCM operations.
Prompt Commands in NCCM Device Template
Prompt commands define how Motadata AIOps responds to CLI prompts encountered during command execution. They are used to automate interactions with devices, especially in scenarios where confirmation, input, or navigation is required during configuration operations.
While executing commands defined in a device template, the system waits for a specific prompt and then performs the corresponding prompt command. This ensures that multi-step command sequences are executed correctly without manual intervention.
Prompt commands are particularly important in NCCM workflows such as:
- Configuration backup and restore
- File transfer operations
- Firmware upgrades
- Interactive CLI-based command execution
Understanding and correctly configuring prompt commands ensures reliable execution of templates across different device types.
Available Prompt Commands
| Command Prompt | Description |
|---|---|
| LF | LF stands for Line Feed. It represents a control character that moves the cursor to the next line without advancing to the next page. It is commonly used to denote the end of a line in text files. |
| yes followed by LF | This indicates entering "yes" and then pressing Enter (LF). It is used when a positive response is required, followed by confirming the action by pressing Enter. |
| y | "y" is a shorthand notation for "yes." It is commonly used in command-line interfaces to acknowledge or confirm an action. |
| y followed by LF | This represents entering "y" and then pressing Enter (LF) to confirm or acknowledge an action. |
| y followed by CR and LF | This represents entering "y" and then pressing Carriage Return (CR) followed by Enter (LF). It might be used as an alternative way to confirm an action. |
| n followed by LF | Indicates entering "n" (no) and then pressing Enter (LF). It is used to provide a negative response or decline an action. |
| yes followed by CR and LF | This represents entering "yes" and then pressing Carriage Return (CR) followed by Enter (LF) to confirm an action. |
| CR and LF | Represents pressing Carriage Return (CR) followed by Enter (LF). It is used to confirm or submit a command or action. |
| CR and Space | Involves pressing Carriage Return (CR) followed by a space. It might be used in specific scenarios where this combination is required. |
| Space | Represents pressing the spacebar. It might be used as an input or to navigate through options. |
| No Command | This indicates no specific command associated with the prompt. It is used when no additional command is required after reaching a specific prompt. |
| LF followed by LF | Represents pressing Enter (LF) twice consecutively. It might be used in scenarios where a double Enter is required. |
| yes | Represents entering "yes" without pressing Enter. It might be used in scenarios where a confirmation is needed without a newline character. |
| no | Represents entering "no" without pressing Enter. It is used when a negative response is required without a newline character. |