Closed FrancisPrakash closed 1 month ago
Using the following example, you can get HA and license statuses
from pprint import pprint from fortigate_api import FortiGate HOST = "host" USERNAME = "username" PASSWORD = "password" fgt = FortiGate(host=HOST, username=USERNAME, password=PASSWORD) # Get HA master/slave status response = fgt.get(url="api/v2/monitor/system/ha-checksums") print(f"GET {response}", ) # POST <Response [200]> result = response.json()["results"] pprint(result) # GET <Response [200]> # [{'checksum': {'all': 'd626cc36457249e24d66cc69003363a7', # ... # 'is_manage_master': 0, # 'is_root_master': 0, # ... # 'is_manage_master': 1, # 'is_root_master': 1, # ... # Get license status response = fgt.get(url="api/v2/monitor/license/status") print(f"GET {response}", ) # POST <Response [200]> result = response.json()["results"] pprint(result) # GET <Response [200]> # {'antispam': {'entitlement': 'SPAM', # 'status': 'no_license', # 'type': 'live_fortiguard_service'}, # 'antivirus': {'db_status': 'db_type_extended', # ...
The suggested script doesn't connect to passive firewall in cluster and get license details..
Using the following example, you can get HA and license statuses