<?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: multidomain and mgmt_cli in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28023#M1649</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok thank you very Lari, this was the missing bit. My guess that the mdsenv command would put you in the right environment was incorrect then.&lt;/P&gt;&lt;P&gt;Still I really do not understand why it worked the first time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2018 07:25:23 GMT</pubDate>
    <dc:creator>Maarten_Sjouw</dc:creator>
    <dc:date>2018-09-21T07:25:23Z</dc:date>
    <item>
      <title>multidomain and mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28018#M1644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to add a number of object this week, I had done some last week. Last week I added them to 1 domain and now I wanted to add them to another domain, what I did upfront was &lt;EM&gt;mdsenv &amp;lt;Domain&amp;gt;&lt;/EM&gt;&amp;nbsp; and started issuing the commands, this worked like a charm.&lt;/P&gt;&lt;P&gt;Today however when I tried to add some objects to another domain, using the same way, first set the mdsenv to the correct domain, then started issuing the (copy paste) the mgmt_cli commands, the objects ended up in the domain that I used last week???&lt;/P&gt;&lt;P&gt;I found out by going in the second domain and use the new network objects but were not there. Then when I issued the &lt;EM&gt;mgmt_cli show networks&lt;/EM&gt; command, it showed me all the network objects from the other domain I worked on last week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hmm, ok maybe I need to do a &lt;EM&gt;set domain name &amp;lt;domain&amp;gt;&lt;/EM&gt; command first? Well in the expert mode with mgmt_cli, that did not work, unknown object.&lt;/P&gt;&lt;P&gt;So ok lets try from clish and use the mgmt commands instead, as the first command used &lt;EM&gt;mgmt set domain name &amp;lt;Domain&amp;gt;&lt;/EM&gt; and then issued the add network commands. they were accepted, no error messages. Going into Smartconsole, none of the networks I added are there, nor in the other domain nor in the Global domain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 18:25:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28018#M1644</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2018-09-19T18:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: multidomain and mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28019#M1645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's is a switch you must add to your mgmt_cli, think it was -s but could be -d, just run help for the command. Works for me every time&amp;nbsp;&amp;nbsp;&amp;nbsp; not at my desk to check&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 16:56:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28019#M1645</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-09-20T16:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: multidomain and mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28020#M1646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 3.84pt; margin-bottom: 0pt; margin-left: 0in; text-indent: 0in;"&gt;Hi Maarten!&lt;/P&gt;&lt;P style="margin-top: 3.84pt; margin-bottom: 0pt; margin-left: 0in; text-indent: 0in;"&gt;In MDS there is one API server serving all the domains, so you should use the MDS leading interface IP address and&amp;nbsp;authenticate to the domain that you want to manipulate.&lt;/P&gt;&lt;P style="margin-top: 3.84pt; margin-bottom: 0pt; margin-left: 0in; text-indent: 0in;"&gt;Example:&lt;/P&gt;&lt;P style="margin-top: 3.84pt; margin-bottom: 0pt; margin-left: 0in; text-indent: 0in;"&gt;&lt;STRONG&gt;# mgmt_cli login user admin password vpn123 domain "MyDomain" &amp;gt; id.txt&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# mgmt_cli add host name “Minion1” ip-address 1.2.3.4 color “yellow” -s id.txt&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# mgmt_cli publish –s id.txt&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# mgmt_cli logout –s id.txt&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-top: 3.84pt; margin-bottom: 0pt; margin-left: 0in; text-indent: 0in;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:43:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28020#M1646</guid>
      <dc:creator>Lari_Luoma</dc:creator>
      <dc:date>2018-09-20T18:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: multidomain and mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28021#M1647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lari is right, you need to login to the desired domain then perform desired commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy pasting Lari's answer with some comments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// login to domain named MyDomain and save 'session-id' into text file called id.txt. (you can use -d "MyDomain" as well)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;# mgmt_cli login user admin password vpn123 domain "MyDomain" &amp;gt; id.txt&amp;nbsp;&lt;/STRONG&gt;&lt;BR style="color: #333333; background-color: #ffffff;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// use the id.txt as a file from which the session-id (your token) is taken and perform&amp;nbsp;add host command.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;# mgmt_cli add host name “Minion1” ip-address 1.2.3.4 color “yellow” -s id.txt&lt;/STRONG&gt;&lt;BR style="color: #333333; background-color: #ffffff;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;// publish and logout (again using the same session-id)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;# mgmt_cli publish –s id.txt&lt;/STRONG&gt;&lt;BR style="color: #333333; background-color: #ffffff;" /&gt;&lt;STRONG style="color: #333333; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;# mgmt_cli logout –s id.txt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few comments on your issue:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;No need for mdsenv when working with API since you should specify which domain you would like to login to.&lt;/LI&gt;&lt;LI&gt;If you don't specify domain, the default is 'System Data' (which means the MDS)&lt;/LI&gt;&lt;LI&gt;In your case, the fact that you didn't see you object in Global or domain is because i guess you didn't specify any domain on your login and thus&amp;nbsp;objects were created in 'System Data' domain (the MDS) so GUI will not show you these kind of objects in MDS....&amp;nbsp;&lt;STRONG style="color: #333333; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 05:10:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28021#M1647</guid>
      <dc:creator>Amiad_Stern</dc:creator>
      <dc:date>2018-09-21T05:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: multidomain and mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28022#M1648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;agreed - i normally use session id to carry out all commands, else just add domain every time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[--domain, -d]&lt;BR /&gt; Name, uid or IP-address of the management domain.&lt;BR /&gt; Environment variable: MGMT_CLI_DOMAIN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 06:27:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28022#M1648</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-09-21T06:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: multidomain and mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28023#M1649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok thank you very Lari, this was the missing bit. My guess that the mdsenv command would put you in the right environment was incorrect then.&lt;/P&gt;&lt;P&gt;Still I really do not understand why it worked the first time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2018 07:25:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/multidomain-and-mgmt-cli/m-p/28023#M1649</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2018-09-21T07:25:23Z</dc:date>
    </item>
  </channel>
</rss>

