bluecmd / fortigate_exporter

Prometheus exporter for Fortigate firewalls
GNU General Public License v3.0
240 stars 77 forks source link

fortigate_exporter REST API #298

Open daniynwa opened 2 months ago

daniynwa commented 2 months ago

I have done testing with

curl 'localhost:9710/probe?target=https://192.168.2.31&token=ghi6eItWzWewgbrFMsazvBVwDjZzzb'

but I get the following error:

2024/09/18 07:19:04 FortigateExporter 1.24.1-1-g2aaf029 ( 2aaf029 )

2024/09/18 07:19:04 Loaded 1 API keys

2024/09/18 07:19:04 Fortigate exporter running, listening on ":9710"

2024/09/18 07:20:39 Error: API connectivity test failed, Get "https://10.11.10.100:21443/api/v2/monitor/system/status": x509: certificate signed by unknown authority

2024/09/18 07:20:39 Probe of "https://10.11.10.100:21443" failed, took 3.104 seconds

fortigate-key.yaml

auth_keys: "https://10.11.10.100:21443": token: api-key-goes-here

daniynwa commented 2 months ago

access in browser https://fwl-psy.digisign.id:21443/api/v2/cmdb/firewall/address/?access_token=

Too Many Requests

The user has sent too many requests in a given amount of time.

Additionally, a 429 Too Many Requests error was encountered while trying to use an ErrorDocument to handle the request.

logs fortigate_exporter

2024/09/22 13:20:43 Probe of "https://fwl-psy.digisign.id:21443" failed, took 0.011 seconds 2024/09/22 13:21:07 Error: Response code was 424, expected 200 (path: "api/v2/monitor/log/fortianalyzer") 2024/09/22 13:21:08 Warning: Response code was 404, expected 200 (path: "api/v2/monitor/system/sensor-info") 2024/09/22 13:21:08 Error: Response code was 404, expected 200 (path: "api/v2/monitor/switch-controller/managed-switch") 2024/09/22 13:21:08 Probe of "https://fwl05-tmt.digisign.id:21443" failed, took 1.161 seconds 2024/09/22 13:21:43 Error: API connectivity test failed, Response code was 401, expected 200 (path: "api/v2/monitor/system/status") 2024/09/22 13:21:43 Probe of "https://fwl-psy.digisign.id:21443" failed, took 0.011 seconds

daniynwa commented 2 months ago

2024/09/23 06:04:41 Warning: Failed to map "" to policy config - this should not happen 2024/09/23 06:04:41 Warning: Failed to map "" to policy config - this should not happen 2024/09/23 06:04:41 Warning: Failed to map "" to policy config - this should not happen 2024/09/23 06:04:41 Error: Response code was 424, expected 200 (path: "api/v2/monitor/log/fortianalyzer") 2024/09/23 06:04:43 Warning: Response code was 404, expected 200 (path: "api/v2/monitor/system/sensor-info") 2024/09/23 06:04:44 Error: Response code was 404, expected 200 (path: "api/v2/monitor/switch-controller/managed-switch") 2024/09/23 06:04:44 Probe of "https://fwl-psy.digisign.id:21443" failed, took 3.093 seconds 2024/09/23 06:05:25 Error: Response code was 424, expected 200 (path: "api/v2/monitor/log/fortianalyzer") 2024/09/23 06:05:26 Warning: Response code was 404, expected 200 (path: "api/v2/monitor/system/sensor-info") 2024/09/23 06:05:26 Error: Response code was 404, expected 200 (path: "api/v2/monitor/switch-controller/managed-switch") 2024/09/23 06:05:26 Probe of "https://fwl05-tmt.digisign.id:21443" failed, took 1.056 seconds