Forum Discussion

Hannes_Rapp's avatar
Hannes_Rapp
Icon for Nimbostratus rankNimbostratus
Aug 30, 2016

How to customize command line prompt?

Well aware of the

$PS1
variable of the BASH shell, but what variable or configuration file controls the prompt of TMSH? I would like to make the command prompt of TMSH a bit slimmer - eliminate config-sync status and partition.

 1) Bash shell, controlled by PS1 variable
[root@localhost:Active] config 

 2) TMSH shell - how do I modify this?
root@(localhost)(cfg-sync Active)(/Common)(tmos) 
  • Thx to @Jason Rahm and @Mark Crosland.

    Here's the answer if anyone else got the same question:

    tmsh help cli preference, there is a limited amount of stuff to choose from, no shell out to bash for random commands or similar.
    
    root@(d3)(cfg-sync Standalone)(Active)(/Common)(tmos) mod cli preference prompt { 
    Options:
      }                     
    Values:
      avc-count              fully-qualified-host   mcp-state              user                   
      config-sync-status     host                   multi-line             user-role             
      current-folder         mcp-load-status        status
    root@(d3)(cfg-sync Standalone)(Active)(/Common)(tmos) mod cli preference prompt { avc-count host … }
    
    • Georgi__Joe__St's avatar
      Georgi__Joe__St
      Icon for Altostratus rankAltostratus

      Thank you :), you saved me from digging in docs 🙂

      I am using this one, hostname is replaced by FQDN and multy-line:

      modify cli preference prompt { user fully-qualified-host config-sync-status status current-folder multi-line }
      
    • Packeteer_69831's avatar
      Packeteer_69831
      Icon for Nimbostratus rankNimbostratus

      I've done some research for an answer, which I've not found, so I figured it would be best to use a thread that's mostly similar to what I am trying to achieve.

       

      I wanted to update the TMSH cli so that all users can see the FQDN of the device in the TMSH parameters. We use TACACS for authentication and authorization.

       

      What I have found is that modifying the CLI prompt in TMSH appears to be a "per user" setting as verified when looking in /config/bigip_user.conf

       

      I am trying to work out if there is a way to modify the CLI such that it applies to all users who login, without having to add a specific entry in the .conf file for each user.

       

      We have a large number of users who access BigIP for various things, and users also come and go as well.

       

      Has anyone achieved something like this?

       

      Thanks.