<?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: API_scripts in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125839#M6118</link>
    <description>&lt;P&gt;OK, thank you very much, I will try&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 04:10:55 GMT</pubDate>
    <dc:creator>sam_huang</dc:creator>
    <dc:date>2021-08-06T04:10:55Z</dc:date>
    <item>
      <title>API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125749#M6101</link>
      <description>&lt;P&gt;Hello everyone, I encountered a problem when using the API here. I hope to get help.&lt;/P&gt;&lt;P&gt;I call the API command in the gateway's Clish, and use mgmt login user (user_name) password (password) ip-address (address) in clish. But I add it to the script and use clish -c "mgmt login ip- address 192.168.10.252 user admin password ***" After running the script, I found that the login was not successful, and no error message was found in the message log file. Does any friend encounter this kind of problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 05:06:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125749#M6101</guid>
      <dc:creator>sam_huang</dc:creator>
      <dc:date>2021-08-05T05:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125761#M6103</link>
      <description>&lt;P&gt;I've never seen anyone call it that way before (i.e. using clish -c in a script).&lt;BR /&gt;Why aren't you using mgmt_cli instead, which can be called from a script?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 06:37:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125761#M6103</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-05T06:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125762#M6104</link>
      <description>&lt;P&gt;clish -c "...." is a &lt;U&gt;single&lt;/U&gt; CLISH command called from bash. API calls will not work like that. To use API from bash and for scripts, do mgmt_cli, as&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;already said.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 06:45:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125762#M6104</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2021-08-05T06:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125836#M6115</link>
      <description>&lt;P&gt;I need to make this action into a scheduled task. I tried to replace clish -c "mgmt" with mgmt_cli, but mgmt_cli will not be executed in the scheduled task&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 04:01:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125836#M6115</guid>
      <dc:creator>sam_huang</dc:creator>
      <dc:date>2021-08-06T04:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125837#M6116</link>
      <description>&lt;P&gt;i know, but mgmt_cli&amp;nbsp;Cannot be used in scheduled tasks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 04:02:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125837#M6116</guid>
      <dc:creator>sam_huang</dc:creator>
      <dc:date>2021-08-06T04:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125838#M6117</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Add this to the top of your script: source /opt/CPshrd-R80.40/tmp/.CPprofile.sh&lt;BR /&gt;(Replace R80.40 with your version)&amp;nbsp;&lt;BR /&gt;This will add mgmt_cli to the path so you can include it in your scripts.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 04:05:32 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125838#M6117</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-06T04:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125839#M6118</link>
      <description>&lt;P&gt;OK, thank you very much, I will try&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 04:10:55 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125839#M6118</guid>
      <dc:creator>sam_huang</dc:creator>
      <dc:date>2021-08-06T04:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125841#M6119</link>
      <description>&lt;P&gt;I tried the method you said, adding at the top of bash:&lt;BR /&gt;source /opt/CPshrd-R81.10/tmp/.CPprofile.sh&lt;BR /&gt;I did not see the execution process in the message log file, but I saw the execution log in the Audit log.&lt;/P&gt;&lt;P&gt;Thank you for your answer&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 04:45:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/125841#M6119</guid>
      <dc:creator>sam_huang</dc:creator>
      <dc:date>2021-08-06T04:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: API_scripts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/126158#M6141</link>
      <description>&lt;P&gt;I use many scripts through the schedulers to run many Check Point tasks and it works well. Your problem is your CP environment is not loaded (Ex: $FWDIR, $PCDIR, etc. are missing) when you execute a CP program through your script. Add this line ". /etc/bashrc" (valid if you are running GAIA) in the top of your script. Example:&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;. /etc/bashrc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Load the Check Point environment if a GAIA (DOT space must be at the beginning of the line)&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;The rest of your script here&lt;/P&gt;&lt;P&gt;If my script is running on a SMB (ex 1400, 1500, etc.), I use: . /pfrm2.0/etc/bashrc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 18:33:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-scripts/m-p/126158#M6141</guid>
      <dc:creator>Maxim_Tremblay</dc:creator>
      <dc:date>2021-08-09T18:33:05Z</dc:date>
    </item>
  </channel>
</rss>

