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

Export all gateways IPs MDS + VSX

Hi Team,

Could you suggest a method to get a list of ALL the IPs of all gateways (Clusters and VSX Clusters) 

Ideally get a list with IPs and object names next to it

 

Nothing less, nothing more 🙂

 

MDS environment with mix of VSX clusters and regular clusters and some simple gateways.

 

Thanking you

 

 

0 Kudos
1 Solution

Accepted Solutions
Bob_Zimmerman
Authority
Authority

Not quite. I have a tool which gets one IP for each firewall, then use CPRID to run something on each of them (thread, Github). I've used that to collect all of the IPs actually in use on the firewalls (and to collect interface status, version information, and more).

VSX support in the API is very limited, but seems to be good enough in R81.20 that I think this should be possible. Poking one of my managements for a bit, it looks like this should do it:

domains="$(mgmt_cli -f json -r true show domains limit 500 | jq '.objects[].name' | tr -d '"' | tr ' ' '\n')";echo "${domains}" | while read domainName;do mgmt_cli -f json -r true -d "${domainName}" show gateways-and-servers limit 500 details-level full | jq -c ".objects[]|{domain:\"${domainName:-$(hostname)}\",name:.name,interface:.interfaces[]|{name:.\"interface-name\",ipv4:.\"ipv4-address\",ipv6:.\"ipv6-address\"}}";done

I don't have any VSX in a multi-domain environment, so I'm not 100% sure how that will interact.

Edit: bumped the call limits up to 500 (the highest they'll go). This could still miss some firewalls if some CMA has more than 100 or so.

View solution in original post

3 Replies
PhoneBoy
Admin
Admin

@Bob_Zimmerman didn't you post a script that basically does this?

Bob_Zimmerman
Authority
Authority

Not quite. I have a tool which gets one IP for each firewall, then use CPRID to run something on each of them (thread, Github). I've used that to collect all of the IPs actually in use on the firewalls (and to collect interface status, version information, and more).

VSX support in the API is very limited, but seems to be good enough in R81.20 that I think this should be possible. Poking one of my managements for a bit, it looks like this should do it:

domains="$(mgmt_cli -f json -r true show domains limit 500 | jq '.objects[].name' | tr -d '"' | tr ' ' '\n')";echo "${domains}" | while read domainName;do mgmt_cli -f json -r true -d "${domainName}" show gateways-and-servers limit 500 details-level full | jq -c ".objects[]|{domain:\"${domainName:-$(hostname)}\",name:.name,interface:.interfaces[]|{name:.\"interface-name\",ipv4:.\"ipv4-address\",ipv6:.\"ipv6-address\"}}";done

I don't have any VSX in a multi-domain environment, so I'm not 100% sure how that will interact.

Edit: bumped the call limits up to 500 (the highest they'll go). This could still miss some firewalls if some CMA has more than 100 or so.

Machine_Head
Advisor
Advisor

This does the job. Thank you very much 🙂

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events