@enable
- Last Updated: May 12, 2023
- 1 minute read
- WhatsUp Gold
- Version 2026
- Version 2025
- Version 2024
- Version 2023.1
Many device configuration tasks require a script to enter a privileged mode in order to execute the necessary device commands. On many devices, privileged mode is entered using the enable command. Typically, running the enable command on a device requires the user to enter a user name and/or password. For devices that implement this style of enable command, scripts can use the Configuration Management @enable command to easily enter privileged mode. The @enable command has no parameters, and is invoked as follows:
@enable
When the @enable command is executed, it does the following:
- It sends
enableto the device followed byCommandTerminator. - If it detects
UserNamePrompt, it sendsSettings.UserNameto the device followed byCommandTerminator. - If it detects
PasswordPrompt, it sendsSettings.PrivilegedPasswordto the device followed byCommandTerminator. IfSettings.PrivilegedPasswordis empty, it usesSettings.Passwordinstead. - After entering the user name and password (if necessary), if
@enabledetectsCommandPrompt, it assumes that enable was successful. Otherwise, it assumes that enable failed.
If at any time the device's output stalls for more than ReadTimeout seconds, it is assumed that something is wrong, and the script returns failure.