Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Moudar
Advisor
Jump to solution

API commands on gateways

Hi

If I want to get info with json of my gateway interface I run this command:

mgmt_cli -r true show interface name "eth0" --context gaia_api --version 1.7 --format json

This command should run on mannagement server or gateway it self?

If i run it on management server I get this:

[Expert@SMS-TEST-API:0]# mgmt_cli -r true show interface name "eth0" --context gaia_api --version 1.7 --format json
{
   "code" : "generic_error",
   "message" : "Error 503. The Management API service is not available. Please check that the Management API server is up and running."
}

even if api status is this:

[Expert@SMS-TEST-API:0]# api status
------------
API Settings:oubleshooting data, please run 'api status -s <comment>'
---------------------
Accessibility:                      Require local
Automatic Start:                    Enabled

Processes:

Name      State     PID       More Information
-------------------------------------------------
API       Started   17939
CPM       Started   17939     Check Point Security Management Server is running and ready
FWM       Started   17559
APACHE    Started   16609

Port Details:
-------------------
JETTY Internal Port:               54316
JETTY Documentation Internal Port: 56451
APACHE Gaia Port:                  443

Profile:
-------------------
Machine profile:                   Small Medium env resources profile
CPM heap size:                     1280m

                          Apache port retrieved from: httpd-ssl.conf


--------------------------------------------
Overall API Status: Started
--------------------------------------------

API readiness test SUCCESSFUL. The server is up and ready to receive connections

Notes:
------------
To collect troubleshooting data, please run 'api status -s <comment>'

and gaia api:

[Expert@SMS-TEST-API:0]# gaia_api status

API Status:
---------------------
Build: cp991255069
Uptime: 2 days, 0:36:33.266998
Current Sessions: Unknown
Latest Version: 1.6

Processes:

Name           State        PID
---------------------------------
GAIA_API       Started      16712
GAIA_API_DOCS  Started      16710
APACHE         Started      16609
CONFD          Started      16607
CLISHD         Started      55921 16675
CELERY         Started      16674
REDIS          Started      16678

Port Details:
-------------------
APACHE Gaia Port:         443

--------------------------------------------
Overall API Status: Stopped
- Error: Apache server unreachable
- Warning: Documentation server is unreachable
--------------------------------------------

 if irun the command directly on the gateway i get this:

[Expert@A-GW-TEST:0]# mgmt_cli -r true show interface name "eth0" --context gaia_api --version 1.7 --format json
Error: Failed to login to the management server
[Expert@A-GW-TEST:0]# gaia_api status

API Status:
---------------------
Build: cp991255069
Uptime: 0:03:47.452001
Current Sessions: 0
Latest Version: 1.6

Processes:

Name           State        PID
---------------------------------
GAIA_API       Started      18650
GAIA_API_DOCS  Started      18648
APACHE         Started      18581
CONFD          Started      18579
CLISHD         Started      23264 22034 18643
CELERY         Started      18642
REDIS          Started      18646

Port Details:
-------------------
APACHE Gaia Port:         443

--------------------------------------------
Overall API Status: Started
--------------------------------------------

 

So, how and where can I run Gaia API commands?

0 Kudos
33 Replies
the_rock
Legend
Legend

As nice as it is watching the game on 70 inch TV, I will settle watching it on 32 inch monitor, haha, not a big deal. Its really bugging me now, so I will spin up brand new R81.20 gateway without any jumbo and test. Will let you know soon the results bro.

Andty

0 Kudos
Alex-
Leader Leader
Leader

You have no hotfixes and sk143612 which describes the GAIA API states that R81.20 runs 1.6.

As of Take 43, it is updated by AutoUpdater but you can use the SK to download the 1.7 version on your test environment.

You will then have to install 1.7 manually.

0 Kudos
the_rock
Legend
Legend

That makes total sense...Im building test fw atm, will confirm, for sure.

Andy

0 Kudos
the_rock
Legend
Legend

@Alex- is 100% correct. See below, without any jumbo after installing api package for 1.7 version from the sk143612

Andy

***********************************************************************************

 

[Expert@FW-API:0]# mgmt_cli show interface name "eth0" --context gaia_api --version 1.7 --format json
Username: admin
Password:
code: "generic_err_command_not_found"
errors: "Requested API command": [v1.7/login] not found'
message: "Command Not Found"
[Expert@FW-API:0]# mgmt_cli show interface name "eth0" --context gaia_api --version 1.6 --format json
Username: admin
Password:
{
"comments": "",
"enabled": true,
"ipv4-address": "172.16.10.254",
"ipv4-mask-length": "24",
"ipv6-address": "Not-Configured",
"ipv6-autoconfig": "Not configured",
"ipv6-local-link-address": "Not Configured",
"ipv6-mask-length": "Not-Configured",
"name": "eth0",
"type": "physical"
}

[Expert@FW-API:0]#


***************************************************************************

After API 1.7 package install

[Expert@FW-API:0]# cd /home/admin
[Expert@FW-API:0]# ls
Check_Point_gaia_api.tgz
[Expert@FW-API:0]# chmod 777 *
[Expert@FW-API:0]# tar -xzvf Check_Point_gaia_api.tgz
os_yaml-1.5-cp991255023.i386.rpm
os_gunicorn-1.5-cp991255023.i386.rpm
os_flask-1.5-cp991255023.i386.rpm
osrc_celery-1.5-cp991255023.i386.rpm
osrc_redis-1.5-cp991255023.i386.rpm
gaia_api-1.7-cp991255104.i686.rpm
install_gaia_api.sh
uninstall_gaia_api.sh
GAIA_API.postman_collection.json
[Expert@FW-API:0]# ./install_gaia_api.sh
Starting gaia_api installation
Old version removed successfully
Installing gaia_api...
Successfully installed gaia_api, use "gaia_api status" to monitor the state
[Expert@FW-API:0]# gaia_api status

API Status:
---------------------
Build: cp991255104
Uptime: 0:00:09.311000
Current Sessions: 0
Latest Version: 1.7

Processes:

Name State PID
---------------------------------
GAIA_API Started 3175
GAIA_API_DOCS Started 3174
APACHE Started 3199
CONFD Started 7409
CLISHD Started 7474
CELERY Started 3172
REDIS Started 3173

Port Details:
-------------------
APACHE Gaia Port: 443

--------------------------------------------
Overall API Status: Started
--------------------------------------------
[Expert@FW-API:0]#


[Expert@FW-API:0]# mgmt_cli show interface name "eth0" --context gaia_api --version 1.7 --format json
Username: admin
Password:
{
"comments": "",
"enabled": true,
"ipv4-address": "172.16.10.254",
"ipv4-mask-length": "24",
"ipv6-address": "Not-Configured",
"ipv6-autoconfig": "Not configured",
"ipv6-local-link-address": "Not Configured",
"ipv6-mask-length": "Not-Configured",
"name": "eth0",
"type": "physical"
}

[Expert@FW-API:0]#

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events