Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
the_rock
MVP Diamond
MVP Diamond

Command to show all the gateways managed by the management server

Hey guys,

Had customer send me this yerterday. Im no api expert by any means, so the command comes in handy.

[Expert@CP-MANAGEMENT:0]# mgmt_cli -r true show-gateways-and-servers limit 500 --format json \
> | jq -r '.objects[] | "\(.name)\t\(.["ipv4-address"] // "-")\t\(.type)"'
CP-FW-01 - cluster-member
CP-FW-02 - cluster-member
CP-FW-CLUSTER - CpmiGatewayCluster
CP-GW - simple-gateway
CP-MANAGEMENT - checkpoint-host
CP-SMARTEVENT - checkpoint-host
[Expert@CP-MANAGEMENT:0]#

Best,
Andy
"Have a great day and if its not, change it"
6 Replies
Vincent_Bacher
MVP Silver
MVP Silver

Could be extended for Multdomain and loop over all domains. 

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
(1)
the_rock
MVP Diamond
MVP Diamond

I should probably create brand new R82 mds lab...had it at some point, but had to delete it.

Best,
Andy
"Have a great day and if its not, change it"
0 Kudos
Vincent_Bacher
MVP Silver
MVP Silver

I have a simple R82.10 lab created to test new IA feature so i could compile it.
This use case is very easy. But of course not performant. It sould of course login and create a session to run on productive devices. ANd i cannot test this on not Multidomain Servers

 for domain in $(mgmt_cli -r true show domains limit 500 offset 0 details-level "standard" --format json | jq -r '.objects[] | .name'); do printf "CMA: %s\n==========\n" "$domain"; mgmt_cli -r true show-gateways-and-servers limit 500 --format json | jq -r '.objects[] | "\(.name)\t\(.["ipv4-address"] // "-")\t\(.type)"'; done
CMA: CMA
==========
CMA_Server      -       checkpoint-host
CMA_ZWO_Server  -       checkpoint-host
fra-r82_10_lab_pdp      -       simple-gateway
fra-r82_10_lab_pep      -       simple-gateway
CMA: CMA_ZWO
==========
CMA_Server      -       checkpoint-host
CMA_ZWO_Server  -       checkpoint-host
fra-r82_10_lab_pdp      -       simple-gateway
fra-r82_10_lab_pep      -       simple-gateway


edith adds: for sure there should be some error handlings and for large environments with more gw than limit to create a loop.

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
Vincent_Bacher
MVP Silver
MVP Silver

Very interesting, thanks for sharing!

I did create similar functions in python for web api calls in a quiet bigger project. Target is to upgrade round about 50 open server pdp only devices using CP- and VMware API from R81.20 to R82

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
the_rock
MVP Diamond
MVP Diamond

O yea, I remember that.

Best,
Andy
"Have a great day and if its not, change it"
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events