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

Finding System boot time or uptime from FortiGate API

I'm searching the API documents to find the uptime field or system boot time we would like to include in one of our tools for monitoring.  I see both values displayed on the System Information tab (system boot time visible by hovering over Uptime field) on the main page but cannot find any reference in the API documents for either of these values.  

 

Forti_Uptime.JPG

2 REPLIES 2
pminarik
Staff
Staff

There doesn't seem to be a call that directly outputs the uptime, but if you do a GET request for /api/v2/monitor/web-ui/state , the JSON output will contain two keys:

"snapshot_utc_time" = current time as of running the request (UTC)

"utc_last_reboot" = time of last (re)boot (UTC)

 

You can either subtract the two, or subtract "utc_last_reboot" from current UTC time to get the uptime.

[ corrections always welcome ]
olseri36
New Contributor

Thanks @pminarik for the quick reply on this, will work for what we need to do!

Labels
Top Kudoed Authors