Technical architecture, cron execution schedule, data formats, and operation guidelines for extracting Fortinet device inventory & running configurations into the Gobo Framework.
root@iinreslvddocker1Authenticates to FortiManager, extracts device catalog to devices.json, formats device list, and splits into 15-device batch chunks.
Executes app.py via Python to import raw device inventory metadata directly into Gobo Framework API.
Loops over batched device lists, extracts running configs from FortiManager via /deployment/export/config, and posts payloads to Gobo.
inventory.sh and configs.shhttps://10.6.152.66/jsonrpc (method: /sys/login/user) with user fortiapi.jq to extract session key into FORTI_SESSION./dvmdb/device to get raw JSON list of all managed devices and saves to devices.json./dvmdb/device, filters names via jq & awk, writing plain text names to list.txt./sys/logout to close FortiManager session./list/* directory and splits list.txt into 15-device chunks (e.g. devices_aa)./home/zkovacs/fortiapi/gobo/list/./deployment/export/config.<chunk>_configs.json matching Gobo import schema.gobo-api-client/app.py with GCP service account credentials to post JSON to Gobo.config_import.log, deletes batch JSON, and logs out.IP: 10.6.152.66
Current target for all script API calls. Handles read/write operations and config exports.
IP: 10.186.152.66
Synchronized database copy. Does not process primary management API requests.
Failover Mode: Manual (no Virtual IP / VRRP enabled). Therefore, automatic failovers will not occur unexpected. If an admin manually promotes the secondary unit (10.186.152.66), the script IP must be updated accordingly.
{
"result": [
{
"data": [
{
"name": "FW-HQ-PRIMARY",
"devid": "FG100E3917800001",
"ip": "10.6.10.1",
"platform_str": "FortiGate-100E",
"os_ver": 7,
"os_type": "fos",
"conn_status": 1,
"db_status": 0
},
{
"name": "FW-BRANCH-CHICAGO",
"devid": "FG60E4821900042",
"ip": "10.12.20.1",
"platform_str": "FortiGate-60E",
"os_ver": 7,
"os_type": "fos",
"conn_status": 1,
"db_status": 0
}
]
}
],
"id": 1
}
FW-HQ-PRIMARY
FW-BRANCH-CHICAGO
FW-BRANCH-DALLAS
FW-BRANCH-MIAMI
FW-BRANCH-SEATTLE
FW-DC-EAST
FW-DC-WEST
FW-STORE-001
FW-STORE-002
FW-STORE-003
FW-STORE-004
FW-STORE-005
FW-STORE-006
FW-STORE-007
FW-STORE-008
FW-STORE-009
FW-STORE-010
# Chunk file: /home/zkovacs/fortiapi/gobo/list/devices_aa (15 lines max)
FW-HQ-PRIMARY
FW-BRANCH-CHICAGO
FW-BRANCH-DALLAS
FW-BRANCH-MIAMI
FW-BRANCH-SEATTLE
FW-DC-EAST
FW-DC-WEST
FW-STORE-001
FW-STORE-002
FW-STORE-003
FW-STORE-004
FW-STORE-005
FW-STORE-006
FW-STORE-007
FW-STORE-008
[
{
"devid": "FW-HQ-PRIMARY",
"configuration": "#config-version=FG100E-7.0.12-build0523\nconfig system global\n set hostname \"FW-HQ-PRIMARY\"\n set timezone 04\nend\nconfig system interface\n edit \"port1\"\n set ip 10.6.10.1 255.255.255.0\n set allowaccess ping ssh https\n next\nend\n"
},
{
"devid": "FW-BRANCH-CHICAGO",
"configuration": "#config-version=FG60E-7.0.12-build0523\nconfig system global\n set hostname \"FW-BRANCH-CHICAGO\"\nend\n"
}
]
# Successfully processed 15-device payload to Gobo API
{
"status": "success",
"imported_records": 15,
"job_id": "dfcc036a-a6b5-4ac8-b69b-7de22a71df79",
"timestamp": "2026-08-05T05:26:40Z"
}
# Historical Error log when batch size was 35 devices (exceeded HTTP body limit)
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>413 Request Entity Too Large</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Request Entity Too Large</h1>
<h2>Your client issued a request that was too large.</h2>
</body></html>
On 2026-08-05 05:26:28, the execution failed because batch payloads contained 35 full FortiManager configurations. The aggregate JSON file size exceeded the max HTTP POST payload limit imposed by the Gobo API gateway / GCP load balancer.
✔ Resolution: Decreasing batch limit to 15 lines ensures all JSON payloads remain comfortably below the upload size threshold.