Notifications and events | laravel-server-monitor | Spatie

 SPATIE

  Laravel Server Monitor
=========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-server-monitor](https://spatie.be/docs/laravel-server-monitor/v1)  Monitoring-basics  Notifications and events

 Version   v1

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

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

Monitoring basics
-----------------

- [ Managing hosts ](https://spatie.be/docs/laravel-server-monitor/v1/monitoring-basics/managing-hosts)
- [ Built in checks ](https://spatie.be/docs/laravel-server-monitor/v1/monitoring-basics/built-in-checks)
- [ Listing hosts and checks ](https://spatie.be/docs/laravel-server-monitor/v1/monitoring-basics/listing-hosts-and-checks)
- [ Writing your own checks ](https://spatie.be/docs/laravel-server-monitor/v1/monitoring-basics/writing-your-own-checks)
- [ Notifications and events ](https://spatie.be/docs/laravel-server-monitor/v1/monitoring-basics/notifications-and-events)

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

- [ Manually modifying hosts and checks ](https://spatie.be/docs/laravel-server-monitor/v1/advanced-usage/manually-configure-hosts-and-checks)
- [ Using your own model ](https://spatie.be/docs/laravel-server-monitor/v1/advanced-usage/using-your-own-model)
- [ Customizing notifications ](https://spatie.be/docs/laravel-server-monitor/v1/advanced-usage/customizing-notifications)
- [ Manipulating processes ](https://spatie.be/docs/laravel-server-monitor/v1/advanced-usage/manipulating-processes)

 Notifications and events
========================

###  On this page

1. [ Throttling notifications ](#content-throttling-notifications)
2. [ Available notifications ](#content-available-notifications)

The package notifies you if certain events take place when running checks on your server. You can specify which channels the notifications for certain events should be sent in the config file. If you don't want any notifications for a particular event, just pass an empty array. Out of the box `slack` and `mail` are supported. If you want to use another channel or modify the notifications, read the section on [customizing notifications](https://docs.spatie.be/laravel-server-monitor/v1/advanced-usage/customizing-notifications).

Throttling notifications
--------------------------------------------------------------------------------------------------------------------------------

To avoid to burying you in notifications when a check fails or emits a warning, we throttle notifications for such events.

By default we only send you one notification an hour per warning or failure per check. When a check succeeds again we'll notify you as soon as possible.

In the [config file](https://docs.spatie.be/laravel-server-monitor/v1/installation-and-setup) your can customize the throttling behaviour by passing a differente value to `throttle_failing_notifications_for_minutes`.

Available notifications
-----------------------------------------------------------------------------------------------------------------------------

### CheckFailed

`Spatie\ServerMonitor\Notifications\Notifications\CheckFailed`

This notification is sent when calling `$this-check->fail()` in a check. This also causes the `Spatie\ServerMonitor\Events\CheckFailed`-event to fire.

This is how the notification looks in Slack.

![](../../images/check-failed.jpg)### CheckWarning

`Spatie\ServerMonitor\Notifications\Notifications\CheckWarning`

This notification is sent when calling `$this-check->warn()` in a check. This also causes the `Spatie\ServerMonitor\Events\CheckWarning`-event to fire.

The notification looks like this in Slack.

![](../../images/check-warning.jpg)### CheckRestored

`Spatie\ServerMonitor\Notifications\Notifications\CheckRestored`

This notification is sent when a check succeeds after it had been failing. The `Spatie\ServerMonitor\Events\CheckRestored` event will be fired as well.

The notification looks like this in Slack.

![](../../images/check-restored.jpg)### CheckSucceeded

`Spatie\ServerMonitor\Notifications\Notifications\CheckSucceeded`

This notification is sent when calling `$this-check->succeed()` in a check. This also fires the `Spatie\ServerMonitor\Events\CheckSucceeded`-event.

You probably don't want to be notified of this event as it is fired many many times.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
