High level overview | laravel-uptime-monitor | Spatie

 SPATIE

  Laravel Uptime Monitor
=========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-uptime-monitor](https://spatie.be/docs/laravel-uptime-monitor/v1)  High level overview

 Version   v3   v2   v1

 Other versions for crawler [v3](https://spatie.be/docs/laravel-uptime-monitor/v3) [v2](https://spatie.be/docs/laravel-uptime-monitor/v2) [v1](https://spatie.be/docs/laravel-uptime-monitor/v1)

- [ Introduction ](https://spatie.be/docs/laravel-uptime-monitor/v1/introduction)
- [ Postcardware ](https://spatie.be/docs/laravel-uptime-monitor/v1/postcardware)
- [ Requirements ](https://spatie.be/docs/laravel-uptime-monitor/v1/requirements)
- [ High level overview ](https://spatie.be/docs/laravel-uptime-monitor/v1/high-level-overview)
- [ Installation and setup ](https://spatie.be/docs/laravel-uptime-monitor/v1/installation-and-setup)
- [ Questions &amp; issues ](https://spatie.be/docs/laravel-uptime-monitor/v1/questions-and-issues)
- [ Changelog ](https://spatie.be/docs/laravel-uptime-monitor/v1/changelog)
- [ About us ](https://spatie.be/docs/laravel-uptime-monitor/v1/about-us)

Monitoring uptime
-----------------

- [ Adding and removing sites ](https://spatie.be/docs/laravel-uptime-monitor/v1/monitoring-uptime/getting-started)
- [ Events ](https://spatie.be/docs/laravel-uptime-monitor/v1/monitoring-uptime/events)
- [ Notifications ](https://spatie.be/docs/laravel-uptime-monitor/v1/monitoring-uptime/notifications)

Monitoring ssl certificates
---------------------------

- [ Getting started ](https://spatie.be/docs/laravel-uptime-monitor/v1/monitoring-ssl-certificates/getting-started)
- [ Events ](https://spatie.be/docs/laravel-uptime-monitor/v1/monitoring-ssl-certificates/events)
- [ Notifications ](https://spatie.be/docs/laravel-uptime-monitor/v1/monitoring-ssl-certificates/notifications)

Advanced usage
--------------

- [ Manually modifying monitors ](https://spatie.be/docs/laravel-uptime-monitor/v1/advanced-usage/manually-modifying-monitors)
- [ Customizing the uptime check ](https://spatie.be/docs/laravel-uptime-monitor/v1/advanced-usage/customizing-the-uptime-check)
- [ Customizing notifications ](https://spatie.be/docs/laravel-uptime-monitor/v1/advanced-usage/customizing-notifications)
- [ Disabling monitors ](https://spatie.be/docs/laravel-uptime-monitor/v1/advanced-usage/disabling-monitors)
- [ Using your own model ](https://spatie.be/docs/laravel-uptime-monitor/v1/advanced-usage/using-your-own-model)
- [ Monitoring from multiple locations ](https://spatie.be/docs/laravel-uptime-monitor/v1/advanced-usage/monitoring-from-multiple-locations)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-uptime-monitor                                                                                                                                                                                                                                    `

High level overview
===================

###  On this page

1. [ Monitoring uptime ](#content-monitoring-uptime)
2. [ Monitoring SSL certificates ](#content-monitoring-ssl-certificates)

Monitoring uptime
-----------------------------------------------------------------------------------------------------------

This package can monitor the uptime of sites, api endpoints, or anything that communicates over `http` or `https`. To create a monitor use the `monitor:create` command. This will create a row in the `monitors` table.

The `monitor:check-uptime` task [should be scheduled](https://docs.spatie.be/laravel-uptime-monitor/v1/installation-and-setup#scheduling) to run every minute. When it runs it will send a request to the `url` of every configured monitor. The package can perform requests concurrently, so don't be afraid to configure a large number of monitors.

If a request succeeds the `Spatie\UptimeMonitor\Events\UptimeCheckSucceeded`-event will fire. The uptime of the monitor will be checked again when `monitor:check-uptime` runs after the interval set in the `uptime_check_interval_in_minutes` key in the config file.

When an uptime check fails the uptime check for that monitor will be performed any time `monitor:check-uptime` runs regardless of the value configured in `uptime_check_interval_in_minutes`.

If an uptime check fails consecutively more times than the value you set in `fire_down_event_after_consecutive_failures` the `Spatie\UptimeMonitor\Events\UptimeCheckFailed` event will fire.

If an uptime check is successful after failing, the `Spatie\UptimeMonitor\Events\UptimeCheckRecovered` will be fired.

Monitoring SSL certificates
-----------------------------------------------------------------------------------------------------------------------------------------

The package can verify if the ssl certificate of a monitor is valid. By default all monitors whose `url` starts with `https` will be checked. This is done by the `monitor:check-certificate` command which should be scheduled to run daily at least.

When a valid certificate for a monitor is found the `Spatie\UptimeMonitor\Events\CertificateCheckSucceeded` event will fire. If no valid certificate is found, the `Spatie\UptimeMonitor\Events\CertificateCheckFailed` event will be unleashed!

If a valid certificate is found, but it will expire in less days than the value set in `fire_expiring_soon_event_if_certificate_expires_within_days` the `Spatie\UptimeMonitor\Events\CertificateExpiresSoon` event is fired.
