Using the REST API, the current values of a range of key cOS Core operational parameters can be retrieved which summarize the current state of the firewall. The information is sent back by cOS Core in JSON format and consists of the values normally provided by the cOS Core CLI stats command plus some additional information.
Note that if more detailed individual statistics are required then the retrieval method described in Chapter 13, Statistics Value Retrieval should be used.
Sending the Statistics Summary Request
To retrieve a summary of key statistical values, an HTTP GET should be sent to the following URI:/api/stats
The GET has no optional parameters.
The Summary Statistics Retrieved
The following is a list of the statistical values sent back in the JSON reply:An Example JSON Reply
Below is an example of a typical JSON reply:{ "error": false, "uptime": { "seconds_total": 191, "days": 0, "hours": 0, "minutes": 3, "seconds": 11 }, "last_event": "2018-02-06 18:23:49: Firmware upgrade request from WebUI by admin (192.168.1.11).", "cpu_load": 14, "memory": { "installed": 2137166035, "free": 1807419356, "largest_free": 1696489544 }, "connections": { "allocated": 256000, "active": 7 }, "fragments": { "allocated": 1024, "active": 0, "lingering": 0 }, "buffers": { "allocated": 24617, "free": 23590, "memory": 33058800, "out_of_buffers": 0 }, "fragbufs": { "allocated": 32, "memory": 322048 }, "active_poll_cores": 1, "incontrol_status": "Not Configured }