<?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: quick list of vs-id and vs-name in cli ? bash script experts needed :) in General Topics</title>
    <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170706#M28442</link>
    <description>&lt;P&gt;I used &lt;A href="https://sc1.checkpoint.com/documents/R81.10/WebAdminGuides/EN/CP_R81.10_SecurityManagement_AdminGuide/Topics-SECMG/CLI/stattest.htm" target="_self"&gt;stattest&lt;/A&gt; in the &lt;A href="https://community.checkpoint.com/t5/Scripts/One-liner-to-show-VPN-S2S-tunnels-on-gateway/m-p/150205" target="_self"&gt;this tool&lt;/A&gt;&amp;nbsp;to create a complete VPN S2S overview on VPN gateways. It should work the same for your demand but you have to figure out the correct query syntax. Maybe you have to use &lt;CODE&gt;stattest get&lt;/CODE&gt;or similar. Just dig into it and do some investigation how to query your VSX data.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2023 12:01:56 GMT</pubDate>
    <dc:creator>Danny</dc:creator>
    <dc:date>2023-02-08T12:01:56Z</dc:date>
    <item>
      <title>quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170695#M28433</link>
      <description>&lt;P&gt;Hi mates,&lt;BR /&gt;&lt;BR /&gt;i am trying to get a list of vs (without virtual switches/router) in cli including vs id and vs name as a table.&lt;BR /&gt;When just running vsx stat -v the names are truncated.&lt;/P&gt;&lt;P&gt;So i created a script including a loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/sh
source /opt/CPshared/5.0/tmp/.CPprofile.sh
source /etc/profile.d/vsenv.sh

VSLIST=`fw vsx stat -v 2&amp;gt;&amp;amp;1 | grep Trust | grep -v '&amp;lt;Not Applicable&amp;gt;' | grep -v 'SIC Status' | awk -F\| '{print $1}'`

for i in $VSLIST ; do
        VSNAME=$( vsx stat $i 2&amp;gt;&amp;amp;1| grep Name | awk '{print $2}' )
        echo $i";"$VSNAME";"
done&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;output is e.g.&lt;BR /&gt;1;vs bla;&lt;BR /&gt;&lt;SPAN&gt;2;vs blubb;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This was fine until now but at several vsx systems we now have &amp;gt; 30 vs and this script takes too long. And other scripts waiting for the result are running into timeouts.&lt;BR /&gt;Any hints to speed up this script or maybe a complete different way to get this list would be appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;/P&gt;&lt;P&gt;VInce&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 10:51:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170695#M28433</guid>
      <dc:creator>Vincent_Bacher</dc:creator>
      <dc:date>2023-02-08T10:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170698#M28434</link>
      <description>&lt;DIV class=""&gt;
&lt;P&gt;You could try to get the data directly from &lt;A href="https://sc1.checkpoint.com/documents/R81/WebAdminGuides/EN/CP_R81_CLI_ReferenceGuide/Topics-CLIG/FWG/stattest.htm" target="_self"&gt;SNMP&lt;/A&gt; via something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;timeout 5 stattest gettable 1.3.6.1.4.1.2620.1.16.22.1 1 2 3 4 5 6 7 8 9 10&lt;/LI-CODE&gt;
&lt;P&gt;OID: 1.3.6.1.4.1.2620.1.16.22.1&lt;BR /&gt;Full path: checkpoint.products.vsx.vsxStatusTable&lt;BR /&gt;Sequences:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1: vsxStatusVSId - INTEGER&lt;/LI&gt;
&lt;LI&gt;2: vsxStatusVRId - INTEGER&lt;/LI&gt;
&lt;LI&gt;3: vsxStatusVsName - DisplayString&lt;/LI&gt;
&lt;LI&gt;4: vsxStatusVsType - DisplayString&lt;/LI&gt;
&lt;LI&gt;5: vsxStatusMainIP - DisplayString&lt;/LI&gt;
&lt;LI&gt;6: vsxStatusPolicyName- DisplayString&lt;/LI&gt;
&lt;LI&gt;7: vsxStatusvsPolicyType - DisplayString&lt;/LI&gt;
&lt;LI&gt;8: vsxStatusSicTrustState - DisplayString&lt;/LI&gt;
&lt;LI&gt;9:&amp;nbsp;vsxStatusHAState -&amp;nbsp;DisplayString&lt;/LI&gt;
&lt;LI&gt;10:&amp;nbsp;vsxStatusVSWeight - Gauge32&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Feb 2023 11:47:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170698#M28434</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2023-02-08T11:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170703#M28439</link>
      <description>&lt;P&gt;interesting approach. Did not know stattest gettable before.....thanks....&lt;BR /&gt;checking.....&lt;BR /&gt;&lt;BR /&gt;# timeout 5 stattest gettable 1.3.6.1.4.1.2620.1.16.22.1 1 2 3 4 5 6 7&lt;BR /&gt;,,,,,,,&lt;BR /&gt;&lt;BR /&gt;hmmmm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 11:50:32 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170703#M28439</guid>
      <dc:creator>Vincent_Bacher</dc:creator>
      <dc:date>2023-02-08T11:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170706#M28442</link>
      <description>&lt;P&gt;I used &lt;A href="https://sc1.checkpoint.com/documents/R81.10/WebAdminGuides/EN/CP_R81.10_SecurityManagement_AdminGuide/Topics-SECMG/CLI/stattest.htm" target="_self"&gt;stattest&lt;/A&gt; in the &lt;A href="https://community.checkpoint.com/t5/Scripts/One-liner-to-show-VPN-S2S-tunnels-on-gateway/m-p/150205" target="_self"&gt;this tool&lt;/A&gt;&amp;nbsp;to create a complete VPN S2S overview on VPN gateways. It should work the same for your demand but you have to figure out the correct query syntax. Maybe you have to use &lt;CODE&gt;stattest get&lt;/CODE&gt;or similar. Just dig into it and do some investigation how to query your VSX data.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 12:01:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170706#M28442</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2023-02-08T12:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170719#M28447</link>
      <description>&lt;P&gt;It's so easy &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for i in `vsx stat -v | grep " S "| awk '{print $1}'| grep '^[0-9]' | sort -n -k1,1`; do vsenv $i &amp;gt;/dev/null; echo -n $i";"; echo $vsname";" | cut -f 2 -d "_"; done&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 13:22:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170719#M28447</guid>
      <dc:creator>Vincent_Bacher</dc:creator>
      <dc:date>2023-02-08T13:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170724#M28448</link>
      <description>&lt;P&gt;Glad you found a solution that you're happy with.&lt;BR /&gt;However, your code does still iterates through all the vsenv's just to fetch the full name of each specific VS. There should be a better way to do it as &lt;CODE&gt;vsx stat -v&lt;/CODE&gt; already does what you want, though it truncates the names it probably reads in uncut.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 13:53:01 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170724#M28448</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2023-02-08T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170753#M28457</link>
      <description>&lt;P&gt;And truncated is not what i want.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 15:44:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170753#M28457</guid>
      <dc:creator>Vincent_Bacher</dc:creator>
      <dc:date>2023-02-08T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: quick list of vs-id and vs-name in cli ? bash script experts needed :)</title>
      <link>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170755#M28459</link>
      <description>&lt;P&gt;And that's why it's a good practice to check how &lt;CODE&gt;vsx stat -v&lt;/CODE&gt; collects the data it is showing or just open a SR and ask TAC for it.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 15:54:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/quick-list-of-vs-id-and-vs-name-in-cli-bash-script-experts/m-p/170755#M28459</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2023-02-08T15:54:28Z</dc:date>
    </item>
  </channel>
</rss>

