Technical Tip: How to get the FortiManager upstream servers list via API
Description
This article describes how to get the FortiManager upstream server list via the API.
Scope
FortiManager.
Solution
To identify the FortiManager JSON-RPC API endpoints, debug the process fdssvrd while running the following CLI command:
diagnose fmupdate view-serverlist <fgd|fds>The upstream FDS servers can then be queried using the following command:Â
diagnose fmupdate view-serverlist fds
This article describes how to get the FortiManager upstream server list via the API.
After formatting the output for readability, the FortiManager JSON-RPC API exchange is as follows:
Request:
{
"id": 4,
"method": "get",
"params": [
{
"data": {
"flags": 0
},
"url": "/um/misc/server_list"
}
],
}
Response:
{
"id": 4,
"result": [
{
"data": {
"loose_mode": 1,
"public_network": 1,
"server_list": [
{
"0": {
"addr": "208.184.237.67",
"distance": 1,
"port": 443,
"src": 4,
"timezone": 0
},
"1": {
"addr": "12.34.97.16",
"distance": 6,
"port": 443,
"src": 4,
"timezone": -5
},
"2": {
"addr": "208.184.237.68",
"distance": 8,
"port": 443,
"src": 4,
"timezone": 9
},
"3": {
"addr": "208.184.237.66",
"distance": 9,
"port": 443,
"src": 4,
"timezone": -8
},
"4": {
"addr": "usfds1.fortinet.com",
"distance": 0,
"port": 443,
"src": 2,
"timezone": 1
},
"count": 5,
"curr_svr_index": 3,
"service_type": "fds"
},
{
"0": {
"addr": "208.184.237.75",
"distance": 9,
"port": 443,
"src": 4,
"timezone": -8
},
"1": {
"addr": "usforticlient.fortinet.net",
"distance": 0,
"port": 443,
"src": 2,
"timezone": 1
},
"count": 2,
"curr_svr_index": 0,
"service_type": "fct"
},
{
"0": {
"addr": "65.210.95.253",
"distance": 6,
"port": 443,
"src": 4,
"timezone": -5
},
"1": {
"addr": "usfqsvr.fortinet.net",
"distance": 0,
"port": 443,
"src": 2,
"timezone": 1
},
"count": 2,
"curr_svr_index": 1,
"service_type": "geoip"
}
]
},
"status": {
"code": 0,
"message": "OK"
},
"url": "misc/server_list"
}
]
}Troubleshooting:
The following commands can be used on the FortiManager CLI to debug the API Calls:
diagnose debug service httpd 255
diagnose debug service main 255
Related document:
