Skip to content

Events & Event handlers

adamkobor edited this page Aug 17, 2020 · 12 revisions

Kuvasz is built around events and their handlers. Every check it makes, emits an event, and the handlers who are subscribed to them handle them in different ways.

Events

MonitorUpEvent

Has been emitted when a website passes the uptime check, i.e. it's live and "healthy". It also contains the latency of the response.

MonitorDownEvent

Has been emitted when a website is unreachable, an it contains the cause of the error.

RedirectEvent

Kuvasz is following redirects through HTTP calls, so when a call is forwarded to an other address, a RedirectEvent will be emitted. It contains the new location from the Location header of the original response.

Event handlers

LogEventHandler

Handled events:

  • MonitorUpEvent
  • MonitorDownEvent
  • RedirectEvent

This handler writes a simple log message to STDOUT and can be switched off through the ENABLE_LOG_EVENT_HANDLER configuration variable.

Examples:

  • Your monitor "test_up" (https://test.com) is UP (200). Latency was: 1826ms.
  • Your monitor "test_down" (https://test2.com) is DOWN. Reason: Connect Error: Connection refused: test2.com
  • Request to "test_redirected" (https://redirected.com) has been redirected

SMTPEventHandler

Handled events:

  • MonitorUpEvent
  • MonitorDownEvent

This handler sends email messages about the state of your monitors. Same events would be suppressed, which means that two or more consecutive UP or DOWN events wouldn't end in more than one email notification.

Clone this wiki locally