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

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
9 Replies
the_rock
Legend
Legend

Hey bro,

All API commands are ran on the management server.

Andy

0 Kudos
the_rock
Legend
Legend

0 Kudos
Moudar
Advisor

0 Kudos
the_rock
Legend
Legend

But you dont run it on the fw, rather management server to get the data.

0 Kudos
Moudar
Advisor

running it on SMS 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."
}
0 Kudos
the_rock
Legend
Legend

Dont worry, I will test it in the lab once home and let you know, just biking/swimming/running now : - )

Andy

0 Kudos
the_rock
Legend
Legend

Just ttried get interfaces flag, worked like a charm. Btw, dont see show interfaces option anywhere in API guide. Make sure, though most people would never change that, that web UI port for mgmt is NOT anything but 443.

clish -> show web ssl-port

Command I tested:

[Expert@CP-MANAGEMENT:0]# mgmt_cli get-interfaces target-name "CP-GW" with-topology true

Andy

0 Kudos
Moudar
Advisor

so why a command like:

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

does not work!

where can i find examples of "target-name" GAIA API or Management API, because i could not find any info there!

0 Kudos
the_rock
Legend
Legend

I dont see show interfaces anywhere in API guide, sorry. Below is what I ran yesterday.

Andy

 

Screenshot_1.png

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events