Recheck - Requesting

How to request a recheck of a Service Check or Host via the Rest API

Re-checks are set asynchronously, so the REST API will return as soon as the submission is entered. There maybe a small delay before the result is displayed in the user interface. On successful submission of re-checks, the response will be of the form:

{
    summary = > {
        num_hosts = >....,
        num_services = >....,
    },
    list = > {
        hosts = >
        [{
            id = >..., hostname = >....
        }, ],
        services = >
        [{
            id = >..., hostname = >..., servicename = >...
        }, ],
    }
}

This reflects the number of hosts and services that this re-check applied to.

In the event of a failure, the response will be:

{
    message => ...,
    detail => ....,
}

Where message will be one of:

  • No objects chosen for recheck (this could also appear if the user does not have access to the objects specified).
  • Errors setting recheck - some objects may have been rechecked.
  • Error when searching for objects.

Example

You can use the below example call to force a recheck of all services against a given host:

./opsview_rest --pretty --username=USERNAME --password=PASSWORD POST "recheck?hostname=HOSTNAME&servicename=%"

If you only want to recheck the host and not any services on it, use:

./opsview_rest --pretty --username=USERNAME --password=PASSWORD POST "recheck?hostname=HOSTNAME&includehosts=1&type=host"