Get gateways count per type (Single, Cluster, VSX) per Domain (CMA/DMS) in a Multi-Domain Security Management (MDSM) environment
cpapi
- Check Point Management API Python SDK v1.12
Clone the repository with this command:
git clone https://github.com/Senas23/cp_mds_licensing
or by clicking on the ‘Download ZIP’ button and using unzip.
Based on the instructions from the CheckPointSW/cp_mgmt_api_python_sdk, download the repository and copy the cpapi
folder into your extracted folder. Currently used cp_mgmt_api_python_sdk
version is v1.12
https://github.com/CheckPointSW/cp_mgmt_api_python_sdk/
https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-gateways-and-servers~v1.5
Either run the process.py
without arguments/parameters and you will be asked for the IPv4/Hostname/FQDN of the Check Point Manamgement Server (SMS/MDS), or run process.py
with an argument of the path to JSON file for offline processing that has the output of the show gateways-and-servers
API against the Check Point Management Server in JSON format.
Run:
chmod u+x process.py
Execute without args/params and you will be asked for inputs to where to connect and which credentials to use
Run:
./process.py
Enter server IPv4 address/hostname/FQDN: 10.1.1.101
Enter username: admin
Enter password: ********
[+] API login successful
[+] API call execution in progress, patience grasshopper ...
...
Run:
./process.py </path/to/file.json>
Domain: Prod
SingleGW: 0 ClusterXL: 2 VS: 100 StandbyMDS: True
TotalCount: 102
Domain: Dev
SingleGW: 3 ClusterXL: 2 VS: 5 StandbyMDS: True
TotalCount: 10
Domain: Lab
SingleGW: 2 ClusterXL: 2 VS: 5 StandbyMDS: False
TotalCount: 9
Primary MDS Total GWs: 121 Standby MDS Total GWs: 112
The kit is developed using Python version 3.6
Tested against R80.30 MDS (Multi Domain Server) with Management API v1.5