<?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: cprid_util for vsx in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10320#M800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cprid only can connect to physical machines as it needs an IP. VS do not need a management IP. Also cprid will not listen on VS ip addresses, but only on VS0 of that system. You can use it to get to a VS, but you need to go to the VS0 of the VS and run your commands there (and vsenv into the right VS beforehand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2018 20:29:02 GMT</pubDate>
    <dc:creator>Christian_Hofma</dc:creator>
    <dc:date>2018-11-28T20:29:02Z</dc:date>
    <item>
      <title>cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10319#M799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can one use cprid_util commands for virtual FWs?&amp;nbsp; I'm trying to get some info from the virtual firewalls.&amp;nbsp; I tried using the virtual FW ip address and get no results.&amp;nbsp; I also tried using the VSX gateway address with vsenv commands and get nothing as well.&amp;nbsp; Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:07:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10319#M799</guid>
      <dc:creator>Bill_Ng</dc:creator>
      <dc:date>2018-11-28T14:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10320#M800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cprid only can connect to physical machines as it needs an IP. VS do not need a management IP. Also cprid will not listen on VS ip addresses, but only on VS0 of that system. You can use it to get to a VS, but you need to go to the VS0 of the VS and run your commands there (and vsenv into the right VS beforehand)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 20:29:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10320#M800</guid>
      <dc:creator>Christian_Hofma</dc:creator>
      <dc:date>2018-11-28T20:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10321#M801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Christian.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would the command look like the following?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cprid_util -server x.x.x.x -verbose rexec -rcmd bash -c "vsenv 3; hostname"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried that and it gives me the following.&lt;/P&gt;&lt;P&gt;'bash: vsenv: command not found'&lt;/P&gt;&lt;P&gt;and the hostname returns the vs0 name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 14:29:40 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10321#M801</guid>
      <dc:creator>Bill_Ng</dc:creator>
      <dc:date>2018-11-29T14:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10322#M802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly you are trying to get groom VS? Hostname command will always return vs0 name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 15:48:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10322#M802</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-11-29T15:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10323#M803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking to script out to get pep information from the VS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;cprid_util -server x.x.x.x -verbose rexec -rcmd bash -c "vsenv 3; pep show user all"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 16:08:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10323#M803</guid>
      <dc:creator>Bill_Ng</dc:creator>
      <dc:date>2018-11-29T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10324#M804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to create a local script on the gateway first and then call it from management using cprid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the script content, here you&amp;nbsp;define the sources that will allow you executing CP commands remotely including vsenv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;#!/bin/bash&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;source /opt/CPshrd-R80/tmp/.CPprofile.sh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;source /opt/CPsuite-R80/fw1/scripts/vsenv.sh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;vsenv&amp;nbsp;6 2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;pep s p a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;save it as file, for example in admin directory as test.sh, then add execute permissions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;chmod +x /home/admin/test.sh&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can call it using cprid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;$CPDIR/bin/cprid_util -server 10.1.1.1 -verbose rexec -rcmd bash -c /home/admin/test.sh&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;Context is set to Virtual Device vsx1_vs-ext (ID 6).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;Command: root-&amp;gt;show-&amp;gt;pdp-&amp;gt;all&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;Source IP ID Connect time Users&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;=========================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px; color: #3366ff;"&gt;127.0.0.1 0x0 13Oct2018 19:34:00 24030&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2018 08:35:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10324#M804</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-11-30T08:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10325#M805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Kaspars!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:45:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/10325#M805</guid>
      <dc:creator>Bill_Ng</dc:creator>
      <dc:date>2018-12-04T15:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: cprid_util for vsx</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/165909#M7369</link>
      <description>&lt;P&gt;So this is a bit old, but I just had to do something similar, and I managed it in a 1 liner. You could extend this to run through multiple domains on the MDS. On my script I have it to clean up my files, but not safe on a public script &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;mgmt_cli -r true -d 172.10.20.9 show-gateways-and-servers --format json details-level full | $CPDIR/jq/jq -r '.objects[] | select (.type=="CpmiVsxClusterMember") | [.name,."ipv4-address"]| @csv' | tr -d '"' | sed 's/,/ /'| while read -r gwname ip;do mdsenv 172.10.20.9;cprid_util -server $ip -verbose rexec -rcmd vsx stat -v | awk '$1 ~ /^[0-9]+$/ { print $1 }' | while read virtualSystemID;do echo -e "vsenv $virtualSystemID\nenabled_blades" &amp;gt;&amp;gt; $gwname.txt;done;sed -i '1s/^/#!\/bin\/bash\nsource $CPDIR\/tmp\/.CPprofile.sh\nsource $FWDIR\/scripts\/vsenv.sh\n/' $gwname.txt;cprid_util putfile -server $ip -local_file $gwname.txt -remote_file /var/tmp/$gwname.txt;cprid_util -server $ip -verbose rexec -rcmd chmod +x /var/tmp/$gwname.txt;cprid_util -server $ip -verbose rexec -rcmd bash -c /var/tmp/$gwname.txt;done&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 04:58:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/cprid-util-for-vsx/m-p/165909#M7369</guid>
      <dc:creator>DanielS</dc:creator>
      <dc:date>2022-12-23T04:58:16Z</dc:date>
    </item>
  </channel>
</rss>

