I created a config-script to show VPN diagnostics via
POST /api/v2/monitor/system/config-script/upload
I can run the script via
POST /api/v2/monitor/system/config-script/run
I tried to fetch the output of my script via
GET /api/v2/monitor/system/config-script
which didn't show the output of my script.
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
So just to confirm, you can actually upload and run the scripts?
And you get no output from the GET /api/v2/monitor/system/config-script method?
Created on 02-17-2023 02:04 PM Edited on 02-17-2023 02:08 PM
Correct. The output I get just shows success without the actual CLI output of my script:
{ "http_method": "GET", "results": { "conf_scripts": { "remote": [], "history": [ { "id": 0, "timestamp": 1676620011, "name": "script", "type": "Local", "status": "Success" } ] }, "backup_service_available": false }, "vdom": "root", "path": "system", "name": "config-script", "action": "", "status": "success", "serial": "FWF40FTK20000000", "version": "v7.2.3", "build": 1262 }
If there is no way to get the script's CLI output via API, maybe websockets can help?
Based on the info on https://fndn.fortinet.net/index.php?/fortiapi/1-fortios/2420/1/system/ this is expected behaviour.
I think the problem is you are trying to use the config-script method to get output via a diagnose or show command which is not the intended purpose.
What information exactly are you trying to glean from the Fortigate?
Created on 02-22-2023 11:02 PM Edited on 05-16-2024 11:41 PM
Correct, I want to get diagnose output like get vpn ike which doesn't seem to be possible via API while other vendors have these features built-in.
Anyways, I figured out how to run such commands via websockets, so I can continue building diagnostic tools for the FortiGate WebUI.
Still it would be nice to be able to utilize the API for this task. Maybe it's possible to tell the config-script/run routine to save the executed commands' output to some other place in the configuration from which another API call could then read it out.
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1713 | |
1093 | |
752 | |
447 | |
231 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.