Skip to main content
olseri36
New Member
January 23, 2024
Question

Finding System boot time or uptime from FortiGate API

  • January 23, 2024
  • 2 replies
  • 3188 views

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

pminarik
Staff
Staff
January 23, 2024

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.

olseri36
olseri36Author
New Member
January 23, 2024

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