Description | This article describes how to check installation log in FortiManager after config or a policy install. |
Scope | FortiManager. |
Solution |
The installing log in FortiManager can be viewed using below methods:
{ "url": "/gui/userauth", "method": "login", "params": { "username": "{{ADMIN_USER}}", "secretkey": "{{PASSWORD}}", "logintype": 0 } }
This will set the cookies for the session, particularly the 'HTTP_CSRF_TOKEN'. This token is then used for subsequent queries to maintain the session.
To get the Install log, use the POST request with 'https://{{host-IP}}/cgi-bin/module/flatui_proxy' and the below query:
{ "url": "/gui/deployment/adom/devices/{{DEVICE_OID}}/tasks/{{TASK_ID}}/log/preview", "method": "get" }
The TASK ID can be obtained using a POST request with 'https://{{host-IP}}//cgi-bin/module/forward' (or using the default https://{{host}}/jsonrpc) and below query:
{ "method": "get", "params": [ { "url": "task/task", "loadsub": 0, "sortings": [ { "id": -1 } ] } ] }
To obtain the DEVICE_OID (OID), use the TASK ID and get the details of the task which includes the OID as well. Use POST request with 'https://{{host-IP}}//cgi-bin/module/forward' (or using the default https://{{host-IP}}/jsonrpc) and below query:
{ "method": "get", "params": [ { "url": "/task/task/{{TASK_ID}}}" } ] }
Related Documents: Configuration revision history. |