<?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: How do I use the gaia-api to run commands on gateways? in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221222#M8608</link>
    <description>&lt;P&gt;To add to what Alex said, you can also check this from web UI.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_1.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/26859i8D30CEAD7887052F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_1.png" alt="Screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2024 14:36:18 GMT</pubDate>
    <dc:creator>the_rock</dc:creator>
    <dc:date>2024-07-18T14:36:18Z</dc:date>
    <item>
      <title>How do I use the gaia-api to run commands on gateways?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221174#M8604</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;for a script which I run with a cron job on the management server, I need to connect to a gateway and run a few commands to extract some information. To solve this, I was thinking about using the gaia-api via mgmt_cli but I am having trouble even authenticating to the gateway.&lt;/P&gt;&lt;P&gt;An example of a command and its output:&lt;/P&gt;&lt;P&gt;In this first example I use a user with read only permissions&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Expert@mgmtname:0]# mgmt_cli gaia-api/show-assets target "125435315-34534-3154-4444-444444"
Username: username
Password: 
code: "err_gaia_api_login_failed"
message: "Cannot login to the Gateway: "125435315-34534-3154-4444-444444"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this second example, I use a RADIUS user with full access to the gateway, Mgmt Server and SmartConsole.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Expert@mgmtname:0]# mgmt_cli gaia-api/show-assets target "125435315-34534-3154-4444-444444"
Username: username
Password: 
code: "err_login_failed"
message: "Authentication to server failed."&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need a locally managed user with read/write permissions, now that I think of it, it would make sense? I wasn't able to find a lot of documentation on this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 10:57:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221174#M8604</guid>
      <dc:creator>796570686578</dc:creator>
      <dc:date>2024-07-18T10:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the gaia-api to run commands on gateways?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221177#M8605</link>
      <description>&lt;P&gt;You need to allow your user account to use the GAIA API, on the gateway.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#api_access~v1.7%20" target="_blank" rel="noopener"&gt;https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#api_access~v1.7%20&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To &lt;STRONG&gt;grant&lt;/STRONG&gt; a user with GAIA API access, use the following command in expert mode:&lt;/P&gt;
&lt;PRE&gt;[Expert@hostname]# gaia_api access --user &amp;lt;user&amp;gt; --enable true&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;To &lt;/SPAN&gt;&lt;STRONG&gt;revoke&lt;/STRONG&gt;&lt;SPAN&gt; GAIA API access from a user, use the following command in expert mode:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;[Expert@hostname]# gaia_api access --user &amp;lt;user&amp;gt; --enable false&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;To &lt;/SPAN&gt;&lt;STRONG&gt;check&lt;/STRONG&gt;&lt;SPAN&gt; whether a user is permitted to use GAIA API, look for 'access-mechanism API' in the output of the following command in CLISH mode:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;hostname&amp;gt; show rba user &amp;lt;user&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This thread covers the topic as well:&amp;nbsp;&lt;A href="https://community.checkpoint.com/t5/Security-Gateways/API-commands-on-gateways/m-p/220704#M42240" target="_blank"&gt;https://community.checkpoint.com/t5/Security-Gateways/API-commands-on-gateways/m-p/220704#M42240&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 11:07:59 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221177#M8605</guid>
      <dc:creator>Alex-</dc:creator>
      <dc:date>2024-07-18T11:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the gaia-api to run commands on gateways?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221220#M8607</link>
      <description>&lt;P&gt;Amazing thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 14:33:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221220#M8607</guid>
      <dc:creator>796570686578</dc:creator>
      <dc:date>2024-07-18T14:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the gaia-api to run commands on gateways?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221222#M8608</link>
      <description>&lt;P&gt;To add to what Alex said, you can also check this from web UI.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_1.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/26859i8D30CEAD7887052F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot_1.png" alt="Screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 14:36:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-I-use-the-gaia-api-to-run-commands-on-gateways/m-p/221222#M8608</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-07-18T14:36:18Z</dc:date>
    </item>
  </channel>
</rss>

