<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Add cluster state to gaia prompt  - clish and bash in Firewall and Security Management</title>
    <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73054#M30239</link>
    <description>&lt;P&gt;Adrian,&lt;/P&gt;
&lt;P&gt;„&lt;SPAN&gt;when we are doing updates on more systems simustaneously&amp;nbsp; and many ssh-terems are on your screen it would be very important, that you know any time who is the master.“&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I understand you and I did such configurations more then once’s. But now after 20 years doing an IT job it‘s time to say goodby to &amp;nbsp;more then 4 terminal session at the same time. That‘s lessons learned, doing to much things at the same time brings more errors and problems then good results.&amp;nbsp;&lt;BR /&gt;You can call me an old boy not able to do multitasking, but if you have requirements todo a lot of updates at the same time you should find another solution then tagging your screen full with terminals.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Wolfgang&lt;/P&gt;
&lt;P&gt;PS: But it would be nice to see the cluster, state in the prompt. Interesting requirement.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 20:32:31 GMT</pubDate>
    <dc:creator>Wolfgang</dc:creator>
    <dc:date>2020-01-22T20:32:31Z</dc:date>
    <item>
      <title>Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72963#M30232</link>
      <description>&lt;P&gt;Bash prompt can be changed by setting env var PS1 to whatever you want. Same with clish executing clish -c "set clienv prompt &amp;lt;text&amp;gt;".&amp;nbsp;&amp;nbsp; But how can I trigger cluster failover in order to place ACTIVE or STANDBY in my prompt? Yes management get's a log, we can have eMail, snmp oder script alerts on that event, but all just on management, not on gateway. Is there a way to execute scripts on gateway triggered by a cluster failover event? &amp;nbsp; Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 09:38:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72963#M30232</guid>
      <dc:creator>Adrian_Pillo</dc:creator>
      <dc:date>2020-01-22T09:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72964#M30233</link>
      <description>&lt;P&gt;Why would one want to trigger cluster failover except for testing purposes ? Who is working on GW CLI constantly and has to be reminded of the node he currently is on ? Or is the question purely academic and not meant for production ?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 09:50:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72964#M30233</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-01-22T09:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72988#M30234</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;no when we are doing updates on more systems simustaneously&amp;nbsp; and many ssh-terems are on your screen it would be very important, that you know any time who is the master.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote this script:&lt;/P&gt;&lt;P&gt;!/bin/bash&lt;BR /&gt;CLUSTER_STATE=$(cphaprob state | grep local | awk '{ print $5 }')&lt;BR /&gt;echo Cluster state is: $CLUSTER_STATE&lt;BR /&gt;export PS1="\e[41;1;33m [$CLUSTER_STATE] \e[40;0;37m [Expert@$HOSTNAME]#"&lt;BR /&gt;echo Prompt is: $PS1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#&lt;BR /&gt;## clish -c "set clienv prompt %M"&lt;/P&gt;&lt;P&gt;&amp;nbsp;The final question is, how ca I trigger this script every time a failover occurs. Obiously it is not enaugh to execute script on logon or perodically.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a event (member goes up or down) which can execute somethig like a customized action, as alert on management is able to do.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 12:31:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72988#M30234</guid>
      <dc:creator>Adrian_Pillo</dc:creator>
      <dc:date>2020-01-22T12:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72992#M30235</link>
      <description>&lt;DIV id="solutionTitleDiv" class="cp_h2_black"&gt;Maybe you find a solution here: sk65923 How to configure the cluster to send SNMP Trap upon failover&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Jan 2020 12:23:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72992#M30235</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-01-22T12:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72998#M30236</link>
      <description>&lt;P&gt;GW sends log/event to logserver/management and management sends snmp. I want to be management independent and get the cluster state direct form gateway. I should request for enhancement on this. One of the most important info on cluster member is active or standby ...&amp;nbsp; cphaprob stat&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 13:36:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/72998#M30236</guid>
      <dc:creator>Adrian_Pillo</dc:creator>
      <dc:date>2020-01-22T13:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73000#M30237</link>
      <description>&lt;P&gt;You did not read the sk - you can also trigger a trap on GW...&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 13:55:01 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73000#M30237</guid>
      <dc:creator>G_W_Albrecht</dc:creator>
      <dc:date>2020-01-22T13:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73048#M30238</link>
      <description>Let's assume you find a way to do this.&lt;BR /&gt;My suggestion: a periodic cron job.&lt;BR /&gt;&lt;BR /&gt;Regardless, if you're in the management UI/CLI when a failover occurs for whatever reason and this script triggers, the clish command will fail since it won't have exclusive lock.&lt;BR /&gt;Further, it won't update the prompt of existing expert mode sessions, only new ones that start.&lt;BR /&gt;&lt;BR /&gt;To get exactly what you want is an RFE.</description>
      <pubDate>Wed, 22 Jan 2020 19:42:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73048#M30238</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-01-22T19:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73054#M30239</link>
      <description>&lt;P&gt;Adrian,&lt;/P&gt;
&lt;P&gt;„&lt;SPAN&gt;when we are doing updates on more systems simustaneously&amp;nbsp; and many ssh-terems are on your screen it would be very important, that you know any time who is the master.“&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I understand you and I did such configurations more then once’s. But now after 20 years doing an IT job it‘s time to say goodby to &amp;nbsp;more then 4 terminal session at the same time. That‘s lessons learned, doing to much things at the same time brings more errors and problems then good results.&amp;nbsp;&lt;BR /&gt;You can call me an old boy not able to do multitasking, but if you have requirements todo a lot of updates at the same time you should find another solution then tagging your screen full with terminals.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Wolfgang&lt;/P&gt;
&lt;P&gt;PS: But it would be nice to see the cluster, state in the prompt. Interesting requirement.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 20:32:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73054#M30239</guid>
      <dc:creator>Wolfgang</dc:creator>
      <dc:date>2020-01-22T20:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73069#M30240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had some similiar challenge in the past and wrote a very tiny shell script that periodically look for a string "&lt;STRONG&gt;Local machine state changed to ACTIVE"&lt;/STRONG&gt; in /var/log/messages, and that would trigger a specific action.&lt;/P&gt;&lt;P&gt;Not sure if the string remains the same in R80.x versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 21:41:59 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73069#M30240</guid>
      <dc:creator>Pedro_Boavida</dc:creator>
      <dc:date>2020-01-22T21:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73070#M30241</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/23756"&gt;@Adrian_Pillo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;this works:-)&lt;/P&gt;
&lt;DIV id="tinyMceEditorHeikoAnkenbrand_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cmd_ak.JPG" style="width: 269px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/4111iD5A33B8C7ECEF54F/image-size/large?v=v2&amp;amp;px=999" role="button" title="cmd_ak.JPG" alt="cmd_ak.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;export PS1="\h $(cphaprob stat |grep local |awk '{print $5}') # "&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you copy this to the following file ".bashrc" in your home directory, it is permanent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
PS1="\h $(cphaprob stat |grep local |awk '{print $5}') # "&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's an interesting idea of you. I built the script into my cluster.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 22:45:59 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73070#M30241</guid>
      <dc:creator>HeikoAnkenbrand</dc:creator>
      <dc:date>2020-01-22T22:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73075#M30242</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/23756"&gt;@Adrian_Pillo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I have added your article to the One Liner collection:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.checkpoint.com/t5/General-Topics/One-liner-collection/td-p/57994" target="_self"&gt;One-liner collection&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 22:56:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73075#M30242</guid>
      <dc:creator>HeikoAnkenbrand</dc:creator>
      <dc:date>2020-01-22T22:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73077#M30243</link>
      <description>&lt;DIV class=""&gt;
&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/23756"&gt;@Adrian_Pillo&lt;/a&gt;&amp;nbsp;wants to change the CLI prompt immediately when the cluster state changes.&lt;BR /&gt;.bashrc is only executed once at user login.&amp;nbsp;Therefore&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;suggested a cronjob.&lt;/P&gt;
&lt;P&gt;I suggest coloring the ClusterXL status at the CLI prompt like this example for&amp;nbsp;&lt;SPAN&gt;~/.&lt;/SPAN&gt;&lt;EM&gt;bashrc&lt;/EM&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then . /etc/bashrc; fi

# User specific aliases and functions
a=`cphaprob stat|grep local|awk '{print $5}'`; case $a in *CTIVE*|*ctive*) a=`tput setaf 2; echo $a`;; *TANDBY*|*tandby*) a=`tput setaf 5; echo $a`;; *) a=`tput setaf 1; echo $a`; esac; PS1="[Expert@\h:$INSTANCE_VSID:$a\e[0m]# "; unset a&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cli_prompt.png" style="width: 259px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/4118iB4953CD4392F780D/image-size/large?v=v2&amp;amp;px=999" role="button" title="cli_prompt.png" alt="cli_prompt.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jan 2020 11:25:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73077#M30243</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2020-01-23T11:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73881#M30244</link>
      <description>&lt;P&gt;I would be a dream when switching to a different VS this check would be done again for the VS I am switching to&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 15:32:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73881#M30244</guid>
      <dc:creator>Sven_Glock</dc:creator>
      <dc:date>2020-01-31T15:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73882#M30245</link>
      <description>&lt;P&gt;I'm working on this. I'll publish a bigger solution for all Check Point systems after CPX.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 15:36:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73882#M30245</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2020-01-31T15:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73888#M30246</link>
      <description>&lt;P&gt;Can't wait seeing it!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 16:23:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/73888#M30246</guid>
      <dc:creator>Sven_Glock</dc:creator>
      <dc:date>2020-01-31T16:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/77700#M30247</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/32376"&gt;@Ziegelsambach&lt;/a&gt;&amp;nbsp;just posted&lt;/P&gt;&lt;DIV class="lia-message-subject"&gt;&lt;A title="Bash CLI Prompt Extentions by boxis-green" href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Bash-CLI-Prompt-Extentions/m-p/77697" target="_self"&gt;Bash CLI Prompt Extentions&lt;/A&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-subject"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;which might be interesting regarding this topic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's all. Have a good day.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 09:18:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/77700#M30247</guid>
      <dc:creator>Joshua</dc:creator>
      <dc:date>2020-03-09T09:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Add cluster state to gaia prompt  - clish and bash</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/83212#M30248</link>
      <description>&lt;P&gt;This has a limitation which is important to note: it runs the command substitution&amp;nbsp;&lt;EM&gt;one time&lt;/EM&gt; at the beginning when PS1 is set. This is undesirable, as the cluster status in the prompt stays the same even if you fail over. To confirm this, run 'echo "$PS1"'. It will show the cluster status in the prompt rather than the command. I posted a set of prompt improvements over on CPUG:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.cpug.org/forums/showthread.php/22738-Command-prompt-improvements" target="_blank" rel="noopener"&gt;https://www.cpug.org/forums/showthread.php/22738-Command-prompt-improvements&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In short, you need to escape the dollar sign to cause the shell not to evaluate it when setting PS1, but to store it to PS1 as a dollar sign instead. Each time the prompt is printed, PS1 is evaluated. Since it contains the $(...) construct, the command substitution is run and the current cluster state at the time of prompt printing is printed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also prefer to index from the end, like so:&lt;/P&gt;&lt;PRE&gt;awk '{print \$NF}'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;$NF is set to the number of fields awk detected.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 17:58:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Add-cluster-state-to-gaia-prompt-clish-and-bash/m-p/83212#M30248</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2020-04-26T17:58:03Z</dc:date>
    </item>
  </channel>
</rss>

