Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
duncan_read
New Contributor

Real server status SNMP monitoring

Hello, I am looking for a way, using SNMP, to monitor the mode and status of a real server behind a virtual server. 

 

So for example if someone has left a server disabled, it would show up on our monitoring software (PRTG)

 

Thanks,

1 REPLY 1
wect
New Contributor

i was able to get this statistics and much more through API, you can also use filters in your API requests. The example with curl is below:

# curl --insecure -H "Accept: application/json" -H "Authorization: Bearer <Your API Key>" 'https://<your FG IP>/api/v2/monitor/firewall/load-balance?count=-1&format=virtual_server_name|list&filter=virtual_server_name=@example.com%20HTTPS'

 

the output would be as follows:

{
"http_method":"GET",
"results":[
{
"virtual_server_name":"example.com HTTPS",
"list":[
{
"real_server_ip":"10.0.0.1",
"real_server_port":443,
"real_server_id":1,
"mode":"active",
"status":"up",
"monitor_events":153,
"active_sessions":49,
"RTT":"<1",
"bytes_processed":123825819983
},
{
"real_server_ip":"10.0.0.2",
"real_server_port":443,
"real_server_id":5,
"mode":"active",
"status":"up",
"monitor_events":137,
"active_sessions":52,
"RTT":"<1",
"bytes_processed":123673959605
}
]
}
],
"vdom":"root",
"path":"firewall",
"name":"load-balance",
"status":"success",
"serial":"FGTXXXXXXXXXXXX",
"version":"v6.4.16",
"build":2098
}

 

I also use PRTG to monitor the status of realservers, you would have to create a custom template for channels to parse JSON and put it in the PRTG directory(C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\rest)

My example is for active sessions:

{
"prtg": {
"description" : {
"device": "FortiGate Load Balancer Stats"
},
"result": [
{
"channel": $.results[0].list[0].real_server_ip ,
"value": $.results[0].list[0].active_sessions
},
{
"channel": $.results[0].list[1].real_server_ip ,
"value": $.results[0].list[1].active_sessions
}
]
}
}

 

So you can then create a custom REST sensor in PRTG

Announcements
Check out our Community Chatter Blog! Click here to get involved
Labels
Top Kudoed Authors