Chapter 9: Host Monitors

Using the REST API, a list of the current cOS Core host monitors with their statistics can be retrieved. The information is sent back by cOS Core in JSON format and consists of the values that might also be provided by using the cOS Core CLI hostmon command.

Sending the Request

To retrieve the host monitor information, an HTTP GET should be sent with the following URI:
/api/oper/hostmon

The GET has no optional parameters.

An Example JSON Reply

Below is an example of a typical JSON reply:

{
  "error":false,
  "hostmonitors":
    [
      {
        "session":4,
        "host":1,
        "reachable":true,
        "protocol":"ICMP",
        "ip":"192.168.1.11",
        "local_ip":"0.0.0.0",
        "interval":10000,
        "sample":10,
        "failed":{"current":0,"max_allowed":2},
        "latency":{"current":132,"max_allowed":800},
        "source_system":"Route"
      }
    ]
}