topic Re: New to Checkpoint Scripting - Where to start from? in API / CLI Discussion and Sampleshttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21097#M1329
<HTML><HEAD></HEAD><BODY><P>I'd appreciate Valeri if I could have 1 only, that one <A href="https://community.checkpoint.com/migrated-users/47446">Jerry Szpinak</A>&nbsp;<img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /></P><P>other 2 might be just due to the fact that I work for quite a few CP customers at the same time ... and my UC accounts indeed blossom recently. Sorry <img id="smileysad" class="emoticon emoticon-smileysad" src="https://community.checkpoint.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" />&nbsp;</P></BODY></HTML>Wed, 22 Aug 2018 10:23:45 GMTJerry2018-08-22T10:23:45ZNew to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21087#M1319
<HTML><HEAD></HEAD><BODY><P>Hello chaps,</P><P></P><P>I'm not new to Checkpoint but very much new to CLI and bit confuse when we talk about CLI in general.</P><P>At the moment, I can see that Checkpoint offers:</P><P></P><UL><LI class=""><A data-command="intro_gui_cli">SmartConsole CLI</A></LI><LI class=""><A data-command="mgmt_cli">The mgmt_cli tool</A></LI><LI class=""><A data-command="gaia_cli">Management CLI in Gaia</A></LI><LI class=""><A data-command="ws">Web Services</A></LI></UL><P></P><P>What are the differences and which one is more reliable where scripting can be create?</P><P></P><P>If all do the same job then why Checkpoint has all of these?</P><P></P><P>I believe it will help all others who are new to CLI.</P><P></P><P>Regards,</P><P>B</P><P><A href="https://community.checkpoint.com/t5/tag/mgmt_cli/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/cli/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/api/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/rest api/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/shell scripting/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/run-script/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/developer/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/bash/tg-p"></A>‌ <A href="https://community.checkpoint.com/t5/tag/commandline/tg-p"></A>‌</P></BODY></HTML>Wed, 22 Aug 2018 08:55:05 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21087#M1319BeaconBits2018-08-22T08:55:05ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21088#M1320
<HTML><HEAD></HEAD><BODY><P>all of this depends HOW you access your environment rather than what CP offers <img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" />&nbsp;</P></BODY></HTML>Wed, 22 Aug 2018 09:19:45 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21088#M1320Jerry2018-08-22T09:19:45ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21089#M1321
<HTML><HEAD></HEAD><BODY><P>sorry, mistakenly clicked "Add Comment" ...</P><P></P><P>so basically CLI is either shell (used by SSH Client) or build on CLI from either WebUI (Gaia Portal) or SmartConsole (there you've got CLI but not to the GW but MGMT server - SMS/MDS) - again, all depends how and where from you're getting access to your so called "CLI".</P><P></P><P>more&nbsp; about this you could read by Support&nbsp; Centre searching for Command Line Access or simply here&nbsp; by looking&nbsp; for "CCC" <img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /></P></BODY></HTML>Wed, 22 Aug 2018 09:21:57 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21089#M1321Jerry2018-08-22T09:21:57ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21090#M1322
<HTML><HEAD></HEAD><BODY><P>so sorry for so many replies mate but I guess what's worth mentioning is that this one you just must read !</P><P></P><P>TOP TOPIC here <img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /></P><P></P><P><A _jive_internal="true" href="https://community.checkpoint.com/thread/5319-my-top-3-check-point-cli-commands">https://community.checkpoint.com/thread/5319-my-top-3-check-point-cli-commands</A></P><P></P><P>Cheers and good luck !</P><P></P><P>Jerry</P></BODY></HTML>Wed, 22 Aug 2018 09:25:02 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21090#M1322Jerry2018-08-22T09:25:02ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21091#M1323
<HTML><HEAD></HEAD><BODY><P><A href="https://community.checkpoint.com/migrated-users/47446">Jerry Szpinak</A>, there is always "Edit" option in the Action menu</P><P></P><P><IMG __jive_id="69693" class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/69693_pastedImage_1.png" /></P></BODY></HTML>Wed, 22 Aug 2018 09:51:54 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21091#M1323_Val_2018-08-22T09:51:54ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21092#M1324
<HTML><HEAD></HEAD><BODY><P>It depends what you want to script, actually.</P><P></P><P>CLI is being used for all kind of things: OS management and configuration, troubleshooting, platform tuning, debug, automated deployment, diagnostics, etc.</P><P></P><P>Let's define a use case for you, then we can advise</P></BODY></HTML>Wed, 22 Aug 2018 09:54:19 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21092#M1324_Val_2018-08-22T09:54:19ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21093#M1325
<HTML><HEAD></HEAD><BODY><P>Hey,</P><P></P><P>It all depends on your preferred way and language to write a script. The several offers that are available come with different backgrounds:</P><P></P><UL><LI class="">SmartConsole CLI =&gt; basically a subview within the SmartConsole that allows you to run API commands and to execute stuff. I think this option is not really often used to run scripts, as you need to have access to the SMS via the SmartConsole in order to use it. [executed via the "command line" button within the SmartConsole]</LI></UL><UL><LI class="">The mgmt_cli tool =&gt; a tool that comes with the installation of the SmartConsole, it is placed in the SmartConsole install directory, also often referred to as "mgmt_cli.exe". It allows you to execute API commands via <STRONG>[edit] batch</STRONG> or powershell and therefore from a client machine without the need to open the SmartConsole.</LI><LI class="">Management CLI in Gaia =&gt; its the same as the "mgmt_cli.exe" with the only difference that this tool is part of the Gaia installation and allows you to execute API commands e.g. locally on the SMS (mgmt_cli commands can be included in bash script, to mention one example).</LI><LI class="">Web Services =&gt; thats the most basic way to use the api, as it is the interface in order to access the RESTful API. You can basically send the required HTTP(S) POST information with the required information via tools like POSTman in order to receive the needed information.</LI></UL><P></P><P>The options "SmartConsole CLI", "mgmt_cli.exe" &amp; mgmt cli on Gaia all depend on the web services base. They basically translate the commands into HTTP(S) requests and send them to the API in order to receive any required information. There are some differences when it comes to the actual API access. If you want to know more about that you can take a look at <A _jive_internal="true" href="https://community.checkpoint.com/thread/8580-management-api-internal-structure">this thread</A>, where I asked how the management api structure itself looks.</P><P>In addition, there are packages for specific language like e.g. <A href="https://github.com/CheckPointSW/cp_mgmt_api_python_sdk">python</A>, that also include functions that can be used in your script, that basically translate into API HTTPS requests and enable you to work with the API without the need to manage the actual HTTPS communication (with session management etc.).</P><P></P><P>Hope that clarifies it for you <img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /></P><P></P><P>Regards,</P><P>Maik</P></BODY></HTML>Wed, 22 Aug 2018 09:57:52 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21093#M1325Maik2018-08-22T09:57:52ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21094#M1326
<HTML><HEAD></HEAD><BODY><P>sorry buddy, when you do that by Mobile Safari ... <IMG src="https://community.checkpoint.com/legacyfs/online/checkpoint/emoticons/silly.png" /></P></BODY></HTML>Wed, 22 Aug 2018 09:59:57 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21094#M1326Jerry2018-08-22T09:59:57ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21095#M1327
<HTML><HEAD></HEAD><BODY><P>btw. how come you've tagged me with some non-existing account? check this out <A href="https://community.checkpoint.com/migrated-users/2138">Valeri Loukine</A>‌ - you've tagged non-existing account holder <IMG src="https://community.checkpoint.com/legacyfs/online/checkpoint/emoticons/grin.png" />&nbsp;</P></BODY></HTML>Wed, 22 Aug 2018 10:01:31 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21095#M1327Jerry2018-08-22T10:01:31ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21096#M1328
<HTML><HEAD></HEAD><BODY><P>That's because there are apparently three accounts of you here. We really need to do some cleanup. Never mind, fixed</P></BODY></HTML>Wed, 22 Aug 2018 10:08:41 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21096#M1328_Val_2018-08-22T10:08:41ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21097#M1329
<HTML><HEAD></HEAD><BODY><P>I'd appreciate Valeri if I could have 1 only, that one <A href="https://community.checkpoint.com/migrated-users/47446">Jerry Szpinak</A>&nbsp;<img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /></P><P>other 2 might be just due to the fact that I work for quite a few CP customers at the same time ... and my UC accounts indeed blossom recently. Sorry <img id="smileysad" class="emoticon emoticon-smileysad" src="https://community.checkpoint.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" />&nbsp;</P></BODY></HTML>Wed, 22 Aug 2018 10:23:45 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21097#M1329Jerry2018-08-22T10:23:45ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21098#M1330
<HTML><HEAD></HEAD><BODY><P>Maik, great explanation!</P></BODY></HTML>Wed, 22 Aug 2018 10:49:17 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21098#M1330Robert_Decker2018-08-22T10:49:17ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21099#M1331
<HTML><HEAD></HEAD><BODY><P>Valeri - I know what CLI does mate.</P><P></P><P>I wanted to know only that. CP has too many CLI like options... such as:</P><P></P><P>We are running multi-domain environment. So I ssh to VSX and created a host object there and I looked in the smart console but I couldn't find that host object in the list. Then I clicked on the "Command Line" button in smartconsole and created there a host object and that appreard in the object DB straight away. Lastly, then I SSHed to management server and created a host object there and then again.. couldn't see the host object in the Smartconsole.</P><P></P><P>So what it shows that each CLI enviornment are different or may be I have poor understanding.</P><P></P><P>If you or anyone can shed some light on this .. would be much appreciated.</P><P></P><P><A href="https://community.checkpoint.com/migrated-users/57462">Maik Dummer</A>‌ did <SPAN style="color: #1f497d;">Elaborate a bit. Thanks Mate. </SPAN></P></BODY></HTML>Wed, 22 Aug 2018 11:03:46 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21099#M1331BeaconBits2018-08-22T11:03:46ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21100#M1332
<HTML><HEAD></HEAD><BODY><P>Good Explanation Maik</P></BODY></HTML>Wed, 22 Aug 2018 11:25:39 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21100#M1332Gaurav_Pandya2018-08-22T11:25:39ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21101#M1333
<HTML><HEAD></HEAD><BODY><P>I am still having trouble understanding your scenario. You are creating a host object where? How do you want to use this object later on? Everything related to security policies should be done on MGMT side first and then delivered with the policy installation to the enforcement points.</P><P></P><P>If that was your task, then yes, you needed MGMT API, and mgmt_cli is just one of the ways to invoke it.&nbsp;</P></BODY></HTML>Wed, 22 Aug 2018 12:53:31 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21101#M1333_Val_2018-08-22T12:53:31ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21102#M1334
<HTML><HEAD></HEAD><BODY><P>The last statement:</P><P>"</P><P>If that was your task, then yes, you needed MGMT API, and mgmt_cli is just one of the ways to invoke it.&nbsp;</P><P>"</P><P>...is more valuebale then whole of this thread. Simple and straight forward.</P><P></P><P>Cheers mate.</P></BODY></HTML>Wed, 22 Aug 2018 14:19:25 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21102#M1334BeaconBits2018-08-22T14:19:25ZRe: New to Checkpoint Scripting - Where to start from?https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21103#M1335
<HTML><HEAD></HEAD><BODY><P>Glad it helps.&nbsp;</P></BODY></HTML>Wed, 22 Aug 2018 14:44:47 GMThttps://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/New-to-Checkpoint-Scripting-Where-to-start-from/m-p/21103#M1335_Val_2018-08-22T14:44:47Z