HomeGuidesAPI ReferenceChangelog
GuidesAPI ReferenceGitHubAirheads Developer CommunityLog In
Guides

REST API Monitoring Examples

Customers can use these procedures to obtain detailed statistics, including the popular request for Tunnels (loss, latency, jitter and so on), interface and flow statistics.

📘

Note: The process for retrieving CPU and memory stats for each EdgeConnect follows a different process and is not file-based.

Getting Statistics Time Range

Appliances generate statistics every minute. Each minute, appliances generate statistics of different types in different CSV files. These CSV files are zipped into a single file for convenience. Appliances are also configured to keep only a certain number of these files. Appliances also retain statistics for a specified time period only. The polling systems (Orchestrator or third-party systems) must get their data before these files age out. Most appliances are configured to keep this data for at least a few
hours. You can configure the length of time appliances keep data in the Orchestrator.

A poller calls the following REST API to get a range of timestamps for which data is present on the appliance:

GET /rest/json/stats/minuteRange

This will return the following output:

{ "newest": "1649778540", "oldest": "1649691900" }

These two numbers are minute boundaries expressed in standard epoch seconds. This example indicates Tuesday, April 12, 2022, 3:49:00 PM to Monday, April 11, 2022, 3:45:00 PM.

Polling for a Specific Minute

Once you obtain the time range, you can iterate over every minute (or start from the last minute not yet retrieved). For example:

for (int i=1649691900; i<=1649778540; i+60) {
 retrieve zip file
 unzip
 insert stats into your database
}

The API for retrieving a zip file for a specific minute looks like this:

GET /rest/json/stats/minuteStats/st2-1649691900.tgz

All the file names start with st2- and are followed by a minute timestamp in epoch seconds. The file extension is .tgz

Specific to 9.3, the Statistics ZIP file content contains the following:

  1. tunnel.csv, tunnel_peak.csv, tunnel_v2.txt
  2. interface.csv, interface_peak.csv, interface_v2.txt
  3. flow.csv, flow_peak.csv, flow_v2.txt
  4. dscp.csv, dscp_peak.csv, dscp_v2.txt
  5. tclass.csv, tclass_peak.csv, tclass_v2.txt
  6. shaper.csv, shaper_v2.txt
  7. jitter.csv, mos.csv
  8. zone_pair.csv, zone_pair_v2.txt
  9. boost.csv, boost_v2.txt
  10. drops.csv, drops_v2.txt
  11. drc.csv
  12. ftype.csv, ftype_peak.csv, ftype_v2.txt
  13. interface_overlay.csv, interface_overlay_v2.txt
  14. health_v2.txt
  15. tunnel_availability_v2.txt
  16. interface_availability_v2.txt
  17. appliance_reachability_v2.txt
  18. probe.csv, probe_v2.txt
  19. inet_bkout.csv, inet_bkout_v2.txt
  20. appperf.csv, appperf_v2.txt

These files are in two different formats:

The two formats are .csv and _v2.txt files is the new format optimized for new StatsCollector. Customers are also recommended to use this file format.


What’s Next