<?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: SmartConsole Result parsing in Firewall and Security Management</title>
    <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19026#M98982</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, please notice that the beginning of the API syntax differs if it runs from within SmartConsole CLI, Gaia clish, expert mode mgmt_cli or via web services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH style="width: 15%;"&gt;API execution mode&lt;/TH&gt;&lt;TH style="width: 15%;"&gt;Prefix for commands&lt;/TH&gt;&lt;TH style="width: 40%;"&gt;Example&lt;/TH&gt;&lt;TH style="width: 15%;"&gt;Supports login / publish?&lt;/TH&gt;&lt;TH style="width: 15%;"&gt;Can grep results?&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;SmartConsole CLI&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;no prefix.&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;add host name "New Host 1" ip-address "192.0.2.1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;No,&amp;nbsp;because it runs on the session that was already logged in. Publish is only supported via GUI button in this case.&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;Gaia clish&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;mgmt&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;mgmt add host name "New Host 1" ip-address "192.0.2.1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;Expert mode mgmt_cli&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;mgmt_cli&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;mgmt_cli add host name "New Host 1" ip-address "192.0.2.1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;Web services&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;sending an HTTP POST request. Notice the command name has all hyphens and no spaces unlike the others&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;POST {{server}}/add-host&lt;BR /&gt;Content-Type: application/json&lt;BR /&gt;X-chkp-sid: {{session}}&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "name" : "New Host 1",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "ip-address" : "192.0.2.1"&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Not directly&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Dec 2017 06:30:05 GMT</pubDate>
    <dc:creator>Tomer_Sole</dc:creator>
    <dc:date>2017-12-27T06:30:05Z</dc:date>
    <item>
      <title>SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19020#M98976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to parse out or filter your results in the SmartConsole CLI like something comparable to grep?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2017 19:25:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19020#M98976</guid>
      <dc:creator>Kip_Banfield</dc:creator>
      <dc:date>2017-12-15T19:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19021#M98977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the expert mode, yes:&lt;/P&gt;&lt;P&gt;[Expert@GW8010:0]# cplic print | grep 419AQF2&lt;/P&gt;&lt;P&gt;11 | 419AQF2 | 13Sep2018 | CPSB-ASPM-DEMO&lt;BR /&gt;[Expert@GW8010:0]#&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From clish, not really.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2017 19:43:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19021#M98977</guid>
      <dc:creator>Vladimir</dc:creator>
      <dc:date>2017-12-15T19:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19022#M98978</link>
      <description>&lt;P&gt;The &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#intro_gui_cli" target="_blank" rel="noopener"&gt;SmartConsole CLI&lt;/A&gt; can be directly accessed from within SmartConsole by clicking the&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 23px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/1805i94409A6A06040F05/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt; icon on the bottom left corner or from the Gaia CLI shell (clish), where you need to login as a management user first.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SmartConsole -&amp;gt; Management CLI:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://sc1.checkpoint.com/documents/latest/APIs/images/smartconsole.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;To access the Management CLI In Gaia's CLI shell (clish) type:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="language-none"&gt;&lt;CODE&gt;mgmt login‍&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE class="language-none"&gt;&lt;CODE&gt;mgmt login user myname‍&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After that you remain in the familiar Gaia shell, but now you can use the management APIs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE class="language-none"&gt;&lt;CODE&gt;&amp;gt; mgmt login user 
Enter password: ******

&amp;gt; show interfaces
eth0
eth0.3
lo
&amp;gt; mgmt add host name myHost12 ip-address 3.3.3.3
&amp;gt; mgmt publish

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message "OK"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number-of-published-changes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1

&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;The syntax is identical to the commands that you run in the SmartConsole GUI.&lt;/LI&gt;
&lt;LI&gt;All management commands start with the word "mgmt".&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Neither Gaia clish not the Management CLI (SmartConsole CLI ) feature any result filters, such as grep, at the moment.&lt;BR /&gt;However, you can access these CLI's from Gaia's expert mode and filter results via grep there.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE class="line-numbers  language-none"&gt;&lt;CODE&gt;[Expert@Management:0]# clish -c "mgmt login user USERNAME password PASSWORD"
[Expert@Management:0]# clish -c "mgmt show-version" | grep edition
os-edition: "64-bit"‍‍‍&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Related article: &lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk98877" target="_blank" rel="noopener"&gt;sk98877&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 12:44:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19022#M98978</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2019-07-04T12:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19023#M98979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Danny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am trying to execute clish -c "mgmt xxx", I am getting database lock errors:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SMS8010&amp;gt; lock database override&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CLICMD0201 Config lock is already turned on.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SMS8010&amp;gt; expert&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Enter expert password:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Warning! All configurations should be done through clish&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;You are in expert mode now.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Expert@SMS8010:0]# clish -c "mgmt login user admin password FakePWD"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CLINFR0771 Config lock is owned by admin. Use the command 'lock database override' to acquire the lock.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[Expert@SMS8010:0]# clish -c "mgmt login user admin"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CLINFR0771 Config lock is owned by admin. Use the command 'lock database override' to acquire the lock.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Enter password:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[Expert@SMS8010:0]# clish -c "mgmt show-version"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CLINFR0771 Config lock is owned by admin. Use the command 'lock database override' to acquire the lock.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; MGMT9205 You are not logged in to management server, in order to log-in you will need to run "mgmt login user [user name]"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[Expert@SMS8010:0]#&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLI is the only active session.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2017 01:49:46 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19023#M98979</guid>
      <dc:creator>Vladimir</dc:creator>
      <dc:date>2017-12-17T01:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19024#M98980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I go into&amp;nbsp;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;SmartConsole CLI&amp;nbsp; From the Icon and try and type&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="border: 0px; font-weight: inherit; font-size: 14px;"&gt;mgmt login it tells me message: "Requested API command: [Mgmt] not found". What I would like to be able to do is do a show_group and parse out just the member names without displaying out the rest of the Information. I can do it from the mgmt_cli when I ssh directly into the management station with this command "mgmt_cli show-group name "Group Name" --root true --format json | $CPDIR/jq/jq ".members[].name"&amp;nbsp;&lt;/CODE&gt;but would like to do the from the&amp;nbsp;&lt;SPAN style="color: #333333; background-color: #ffffff;"&gt;SmartConsole CLI.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Dec 2017 19:55:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19024#M98980</guid>
      <dc:creator>Kip_Banfield</dc:creator>
      <dc:date>2017-12-26T19:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19025#M98981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are in the SmartConsole CLI, you do not need to login as you are already logged in.&lt;/P&gt;&lt;P&gt;As far as I know, you cannot pipe output from the SmartConsole CLI to another Unix shell command.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 06:24:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19025#M98981</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2017-12-27T06:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: SmartConsole Result parsing</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19026#M98982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, please notice that the beginning of the API syntax differs if it runs from within SmartConsole CLI, Gaia clish, expert mode mgmt_cli or via web services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH style="width: 15%;"&gt;API execution mode&lt;/TH&gt;&lt;TH style="width: 15%;"&gt;Prefix for commands&lt;/TH&gt;&lt;TH style="width: 40%;"&gt;Example&lt;/TH&gt;&lt;TH style="width: 15%;"&gt;Supports login / publish?&lt;/TH&gt;&lt;TH style="width: 15%;"&gt;Can grep results?&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;SmartConsole CLI&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;no prefix.&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;add host name "New Host 1" ip-address "192.0.2.1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;No,&amp;nbsp;because it runs on the session that was already logged in. Publish is only supported via GUI button in this case.&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;Gaia clish&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;mgmt&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;mgmt add host name "New Host 1" ip-address "192.0.2.1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;Expert mode mgmt_cli&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;mgmt_cli&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;mgmt_cli add host name "New Host 1" ip-address "192.0.2.1"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="width: 15%;"&gt;Web services&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;sending an HTTP POST request. Notice the command name has all hyphens and no spaces unlike the others&lt;/TD&gt;&lt;TD style="width: 40%;"&gt;&lt;SPAN class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;POST {{server}}/add-host&lt;BR /&gt;Content-Type: application/json&lt;BR /&gt;X-chkp-sid: {{session}}&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "name" : "New Host 1",&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "ip-address" : "192.0.2.1"&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Yes&lt;/TD&gt;&lt;TD style="width: 15%;"&gt;Not directly&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2017 06:30:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/SmartConsole-Result-parsing/m-p/19026#M98982</guid>
      <dc:creator>Tomer_Sole</dc:creator>
      <dc:date>2017-12-27T06:30:05Z</dc:date>
    </item>
  </channel>
</rss>

