<?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: Bash CLI Prompt Extentions in Firewall and Security Management</title>
    <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/110904#M15260</link>
    <description>&lt;P&gt;This is really cool.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2021 10:40:27 GMT</pubDate>
    <dc:creator>Joshua</dc:creator>
    <dc:date>2021-02-16T10:40:27Z</dc:date>
    <item>
      <title>Bash CLI Prompt Extentions</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/77697#M5978</link>
      <description>&lt;P&gt;I wrote a few alternative Bash CLI Prompt Extentions for Gaia expert mode&lt;/P&gt;&lt;P&gt;Cluster-Gateway short:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="GW_short.png" style="width: 315px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/4758iE01DE14A25169973/image-size/large?v=v2&amp;amp;px=999" role="button" title="GW_short.png" alt="GW_short.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Expert@HOSTNAME:VSID:VERSION:&lt;STRONG&gt;CLUSTER-STATUS&lt;/STRONG&gt;]#&lt;/P&gt;&lt;P&gt;Command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;update(){&lt;/P&gt;&lt;P&gt;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;&lt;/P&gt;&lt;P&gt;PS1="[Expert@\h:$INSTANCE_VSID:\033[1m$version\033[0m:$a\e[0m]# "&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;version=$(cpstat os -f all | grep "SVN Foundation Version String:" | cut -f 15 -d ' ');&lt;/P&gt;&lt;P&gt;PROMPT_COMMAND=update&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Cluster-Gateway long:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="GW_long.png" style="width: 620px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/4759i78999633529D5F4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="GW_long.png" alt="GW_long.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[VERSION:&lt;STRONG&gt;Cluster-Status&lt;/STRONG&gt;:&lt;STRONG&gt;RAM&lt;/STRONG&gt;:&lt;STRONG&gt;CPU Usage&lt;/STRONG&gt;:SecureXL-Status:CoreXL-Status]&lt;/P&gt;&lt;P&gt;[Expert@HOSTNAME:VSID]#&lt;/P&gt;&lt;P&gt;Command:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;update(){&lt;/P&gt;&lt;P&gt;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;&lt;/P&gt;&lt;P&gt;f_rammb=$(free -m |grep "Mem:" |awk '{print $3}');f_ramdec=${f_rammb:${#f_rammb}-3:${#f_rammb}};f_ramint=${f_rammb:0:${#f_rammb}-3};&lt;/P&gt;&lt;P&gt;f_ramgb=$(echo "$f_ramint.$f_ramdec");f_ramgb=${f_ramgb:0:${#f_ramgb}-2};&lt;/P&gt;&lt;P&gt;cpu=$(uptime | rev | awk '{print $3}'|tr -d ',' | rev);&lt;/P&gt;&lt;P&gt;PS1="[\033[1m$version\033[0m:$a\e[0m:\e[96m\]RAM=$f_ramgb/$m_ramgb\]GB\e[0m:\e[36m\]CPU Usage=$cpu\e[0m:\e[1;35m\]SecureXL=$securexl\e[0m:\e[1;32m\]CoreXL Active=$corexl\e[0m]\n[Expert@\h:$INSTANCE_VSID]# ";&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;m_rammb=$(free -m |grep "Mem:" |awk '{print $2}');m_ramdec=${m_rammb:${#m_rammb}-3:${#m_rammb}};m_ramint=${m_rammb:0:${#m_rammb}-3};&lt;/P&gt;&lt;P&gt;m_ramgb=$(echo "$m_ramint.$m_ramdec");m_ramgb=${m_ramgb:0:${#m_ramgb}-2};&lt;/P&gt;&lt;P&gt;version=$(cpstat os -f all | grep "SVN Foundation Version String:" | awk '{print $5}');&lt;/P&gt;&lt;P&gt;securexl=$(fwaccel stat | grep Acceleration | awk '{print $3}'| tr -d '|');&lt;/P&gt;&lt;P&gt;if [ -z "$(fw ctl multik stat)" ];then corexl="Disabled";else corexl=$(fw ctl multik stat | cut -f 2 -d '|'|tail -n +3);iterations=$(echo $corexl|wc -w) cores_active=0;for((i=1;i&amp;lt;=$iterations;i+=1));&lt;/P&gt;&lt;P&gt;do core=$(echo $corexl|cut -f $i -d ' ');if [ "Yes" == $core ]; then cores_active=$((cores_active+1));fi;done;if [ "$cores_active" -eq "$iterations" ]; then corexl="ALL";else corexl=$cores_active;fi;fi;&lt;/P&gt;&lt;P&gt;PROMPT_COMMAND=update&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Management&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Mgmt_1.png" style="width: 303px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/4760i7674493AC0356F90/image-size/large?v=v2&amp;amp;px=999" role="button" title="Mgmt_1.png" alt="Mgmt_1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Mgmt_2.png" style="width: 467px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/4761i1BF4D7CB03E0E8B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Mgmt_2.png" alt="Mgmt_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[VERSION:MgmtHA-Configuration-&lt;STRONG&gt;HA-Status&lt;/STRONG&gt;:&lt;STRONG&gt;RAM&lt;/STRONG&gt;:&lt;STRONG&gt;CPU Usage&lt;/STRONG&gt; ]&lt;/P&gt;&lt;P&gt;[Expert@HOSTNAME:VSID]#&lt;/P&gt;&lt;P&gt;Command:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;update(){&lt;/P&gt;&lt;P&gt;f_rammb=$(free -m |grep "Mem:" |awk '{print $3}');f_ramdec=${f_rammb:${#f_rammb}-3:${#f_rammb}};f_ramint=${f_rammb:0:${#f_rammb}-3};&lt;/P&gt;&lt;P&gt;f_ramgb=$(echo "$f_ramint.$f_ramdec");f_ramgb=${f_ramgb:0:${#f_ramgb}-2};&lt;/P&gt;&lt;P&gt;cpu=$(uptime | rev | awk '{print $3}'|tr -d ',' | rev);&lt;/P&gt;&lt;P&gt;if [[ -e $MDS_FWDIR/conf/peers.C ]]; then a=$(cpstat mg|grep status|awk '{print $3}'|tr "[a-z]" "[A-Z]"); case $a in *CTIVE*|*ctive*) a=`tput setaf 2; echo $a`;; *TANDBY*|*tandby*) a=`tput setaf 5;&lt;/P&gt;&lt;P&gt;echo $a`;; *) a=`tput setaf 1; echo $a`; esac;&lt;/P&gt;&lt;P&gt;PS1="[\033[1m$version\033[0m:$mgmtHA-$mgmtconf-$a\e[0m:\e[96m\]RAM=$f_ramgb/$m_ramgb\]GB\e[0m:\e[36m\]CPU Usage=$cpu\e[0m]\n[Expert@\h:$NSID_NUMBER]# ";&lt;/P&gt;&lt;P&gt;else PS1="[\033[1m$version\033[0m:\e[96m\]RAM=$f_ramgb/$m_ramgb\]GB\e[0m:\e[36m\]CPU Usage=$cpu\e[0m]\n[Expert@\h:$NSID_NUMBER]# ";fi;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;m_rammb=$(free -m |grep "Mem:" |awk '{print $2}');m_ramdec=${m_rammb:${#m_rammb}-3:${#m_rammb}};m_ramint=${m_rammb:0:${#m_rammb}-3};&lt;/P&gt;&lt;P&gt;m_ramgb=$(echo "$m_ramint.$m_ramdec");m_ramgb=${m_ramgb:0:${#m_ramgb}-2};&lt;/P&gt;&lt;P&gt;if [[ -e $MDS_FWDIR/conf/peers.C ]]; then mgmtHA="MgmtHA"; if [ $(cpprod_util FwIsPrimary) ]; then mgmtconf="Prim"; else mgmtconf="Sec";fi;fi;&lt;/P&gt;&lt;P&gt;version=$(cpstat os -f all | grep "SVN Foundation Version String:" | cut -f 15 -d ' ');&lt;/P&gt;&lt;P&gt;PROMPT_COMMAND=update&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 08:55:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/77697#M5978</guid>
      <dc:creator>Ziegelsambach</dc:creator>
      <dc:date>2020-03-09T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bash CLI Prompt Extentions</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/77941#M5991</link>
      <description>Wow, this helps a lot Thanks!&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Mar 2020 07:48:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/77941#M5991</guid>
      <dc:creator>Dennis_M</dc:creator>
      <dc:date>2020-03-11T07:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bash CLI Prompt Extentions</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/110904#M15260</link>
      <description>&lt;P&gt;This is really cool.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 10:40:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/Bash-CLI-Prompt-Extentions/m-p/110904#M15260</guid>
      <dc:creator>Joshua</dc:creator>
      <dc:date>2021-02-16T10:40:27Z</dc:date>
    </item>
  </channel>
</rss>

