Skip to content

Monitor management

adamkobor edited this page Sep 9, 2020 · 7 revisions

Your monitors are your base entities when it comes to the management of Kuvasz. They encapsulate all of the necessary informations that are needed to run any kind of checks against a website.

You can:

  • create,
  • update, or
  • delete

a monitor.

Manipulating monitors

While it is possible to manipulate your monitors directly in the database (followed by restarting the service), this approach is discouraged, because it doesn't guarantee the consistency of your data. Instead, you should use the API of Kuvasz to do these things.

There are dedicated endpoints for:

  • creation -> POST /monitors
  • update -> PATCH /monitors/{id}
  • deletion -> DELETE /monitors/{id}

Unique names

When you create a new monitor, you have to make sure that the name of it is unique, otherwise you'll get back a 400 - Bad Request from the service.

uptimeCheckInterval

The uptimeCheckInterval property on the API represents the interval between two consecutive uptime check in seconds. The shortest interval you can set is 60 seconds.

Disable vs. delete

If you want to permanently remove a monitor and all of its historical data, you should go with the DELETE endpoint mentioned above. However, if you just want to temporarily disable a monitor, you can use the PATCH endpoint with the following payload:

{
    "enabled": false
}

Modifying a monitor

Through the provided PATCH endpoint you can make partial updates to a monitor, which means that you don't have to specify the value of a property if you don't want to touch it at all.

Example (Updating only the uptimeCheckInterval property of a monitor):

curl --location --request PATCH 'https://your.host:8080/monitors/4' \
--header 'Authorization: Bearer YourAccesstoken' \
--header 'Content-Type: application/json' \
--data-raw '{
    "uptimeCheckInterval": 120
}'

Enable SSL check for a given monitor

You can enable the SSL checking for a given monitor by providing a true value for the sslCheckEnabled property when you create or update the monitor. SSL checks are happening one minute after you create or update a monitor, and periodically (once a day) after that. If you completely disable a monitor (by its enabled property), SSL checks won't be scheduled for it (enabled works as a "main" switch).

Example (Updating only the sslCheckEnabled property of a monitor):

curl --location --request PATCH 'https://your.host:8080/monitors/4' \
--header 'Authorization: Bearer YourAccesstoken' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sslCheckEnabled": true
}'
Clone this wiki locally