NetScaler set CLI prompt – changing the CLI prompt

Setting the CLI prompt on NetScaler can be used to provide warning messages to users such as Authorised users only or you could set a message of Use of this account to perform configurations is prohibited, please log off if for example you did not want anyone using the default nsroot account to make changes via CLI.

To set a CLI prompt navigate to System -> Users and edit an existing user. Note CLI prompts can also be set against Groups when you want a group of users to receive the prompt. I’ll use the nsroot account in this example.1-min

Click the edit icon.2-min

Enter a custom CLI prompt message and then click Continue. For this message you can include the current date, time, NetScaler hostname, username etc. using a mixture of variables such as %d for the current date.3-min

Click Save.4-min

Click Done.5-min

The next time someone authenticates to CLI using the nsroot account the warning will be displayed. Notice the date is also displayed which is the result of defining %d within the CLI prompt message.6-min

You can also show information such as the username logged on, the node state or hostname. This can be done via GUI as shown above or the CLI.

The CLI command set cli prompt “%u %h %d %s” shows the logged on username, NetScaler hostname, current date and state of the appliance (Primary/Secondary).

To reset the CLI prompt to show nothing, simply run command set cli prompt “”.

You can also change the output colour so long as colours are supported by whichever terminal program you use to connect to NetScaler CLI. Use command set cli mode color ON to turn on and to turn off use set cli mode color OFF.


Leave a Reply