<?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: Incorrect results running CLI script in parallel in VSX in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19526#M1204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that a VS is not fully isolated from other VSes (to &lt;A href="https://community.checkpoint.com/migrated-users/61934"&gt;Michael Rolbin&lt;/A&gt;‌'s point).&lt;/P&gt;&lt;P&gt;It's possible this could change in the future, but it's true as of R80.10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, assuming xargs spawns unique processes, I would think sourcing that particular script would work properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Dec 2018 21:02:21 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2018-12-28T21:02:21Z</dc:date>
    <item>
      <title>Incorrect results running CLI script in parallel in VSX</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19524#M1202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have some SSH expert mode bash scripts that run against large VSX deployments, and, for various reasons, we've been trying to speed up the runtime of these scripts. One thing we've tried is executing a script in parallel. E.g.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;vsx stat -l | awk '/^VSID:/{ print $NF }' | &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;xargs -n 1 -P 4 -I{} bash -c 'id={}; result=`source /etc/profile.d/vsenv.sh; vsenv $id &amp;amp;&amp;amp; ifconfig`; echo "$result"'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xargs options:&lt;BR /&gt;-n max args&lt;BR /&gt;-P max procs&lt;BR /&gt;-i --&amp;gt; -i{} -- in the following command to xargs, for each line of input from stdin, replace {} with that input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I.e., we use &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;vsx stat -l&lt;/SPAN&gt;&amp;nbsp;to extract the VSID, then for each VS, we execute &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;ifconfig&lt;/SPAN&gt; and dump the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's really fast, but we see some&amp;nbsp;incorrect results: ifconfig reports the same IP for each interface in each VS; if we run it serially, we get correct output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We're suspecting that this 'initialization' of the bash environment, &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;bash -c 'id={}; result=`source /etc/profile.d/vsenv.sh...'&amp;nbsp;&lt;/SPAN&gt;isn't creating a "complete" Check Point shell environment (like the one you'd get if you SSH'd in). Just a guess.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have suggestions on how to properly initialize the shell? Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Dec 2018 22:07:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19524#M1202</guid>
      <dc:creator>Hawkeye_Parker</dc:creator>
      <dc:date>2018-12-26T22:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results running CLI script in parallel in VSX</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19525#M1203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to the question, could it be related to how Linux VRF for VSX was implemented?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2018 17:45:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19525#M1203</guid>
      <dc:creator>Michael_Rolbin</dc:creator>
      <dc:date>2018-12-27T17:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results running CLI script in parallel in VSX</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19526#M1204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that a VS is not fully isolated from other VSes (to &lt;A href="https://community.checkpoint.com/migrated-users/61934"&gt;Michael Rolbin&lt;/A&gt;‌'s point).&lt;/P&gt;&lt;P&gt;It's possible this could change in the future, but it's true as of R80.10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, assuming xargs spawns unique processes, I would think sourcing that particular script would work properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 21:02:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19526#M1204</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2018-12-28T21:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect results running CLI script in parallel in VSX</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19527#M1205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your bash script is a little bit complicated.&lt;/P&gt;&lt;P&gt;More elegant solution:&lt;/P&gt;&lt;P&gt;Command "show interface &amp;lt;interface.vlan&amp;gt;" from clish has great "feature" that it will show you on which vs instance particular VLAN is configured. Just grep it before XY lines (grep -B 5) and you have all interfaces configured on specifix vsid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Dec 2018 21:32:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Incorrect-results-running-CLI-script-in-parallel-in-VSX/m-p/19527#M1205</guid>
      <dc:creator>JozkoMrkvicka</dc:creator>
      <dc:date>2018-12-29T21:32:06Z</dc:date>
    </item>
  </channel>
</rss>

