Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get license status of passive firewall in HA Cluster mode via API ? #33

Closed
FrancisPrakash opened this issue Jun 28, 2024 · 2 comments

Comments

@FrancisPrakash
Copy link

No description provided.

@vladimirs-git
Copy link
Owner

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',
#   ...

@FrancisPrakash
Copy link
Author

The suggested script doesn't connect to passive firewall in cluster and get license details..

Repository owner locked and limited conversation to collaborators Aug 6, 2024
@vladimirs-git vladimirs-git converted this issue into discussion #36 Aug 6, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants