spatie/laravel-uptime-monitor
Composer 安装命令:
composer require spatie/laravel-uptime-monitor
包简介
A powerful, easy to configure uptime monitor
README 文档
README
Powerful and easy to configure uptime monitor
Laravel-uptime-monitor is a powerful, easy to configure uptime monitor. It will notify you when your site is down (and when it comes back up). You can also be notified a few days before an SSL certificate on one of your sites expires. Under the hood, the package leverages Laravel native notifications, so it's easy to use Slack, Telegram or your preferred notification provider.
You'll find extensive documentation on [https://spatie.be/docs/laravel-uptime-monitor]. It includes detailed info on how to install and use the package.
If you're not familiar with Laravel, but still want to use our uptime monitor, take a look at the uptime-monitor-app repo which contains a stand alone version of this package.
Reading the config file of this package is a good way to quickly get a feel of what laravel-uptime-monitor can do. Here's the content of the config file:
return [ /* * You can get notified when specific events occur. Out of the box you can use 'mail' * and 'slack'. Of course you can also specify your own notification classes. */ 'notifications' => [ 'notifications' => [ \Spatie\UptimeMonitor\Notifications\Notifications\UptimeCheckFailed::class => ['slack'], \Spatie\UptimeMonitor\Notifications\Notifications\UptimeCheckRecovered::class => ['slack'], \Spatie\UptimeMonitor\Notifications\Notifications\UptimeCheckSucceeded::class => [], \Spatie\UptimeMonitor\Notifications\Notifications\CertificateCheckFailed::class => ['slack'], \Spatie\UptimeMonitor\Notifications\Notifications\CertificateExpiresSoon::class => ['slack'], \Spatie\UptimeMonitor\Notifications\Notifications\CertificateCheckSucceeded::class => [], ], /* * The location from where you are running this Laravel application. This location will be * mentioned in all notifications that will be sent. */ 'location' => '', /* * To keep reminding you that a site is down, notifications * will be resent every given number of minutes. */ 'resend_uptime_check_failed_notification_every_minutes' => 60, 'mail' => [ 'to' => ['your@email.com'], ], 'slack' => [ 'webhook_url' => env('UPTIME_MONITOR_SLACK_WEBHOOK_URL'), ], /* * Here you can specify the notifiable to which the notifications should be sent. The default * notifiable will use the variables specified in this config file. */ 'notifiable' => \Spatie\UptimeMonitor\Notifications\Notifiable::class, /** * The date format used in notifications. */ 'date_format' => 'd/m/Y', ], 'uptime_check' => [ /* * When the uptime check could reach the url of a monitor it will pass the response to this class * If this class determines the response is valid, the uptime check will be regarded as succeeded. * * You can use any implementation of Spatie\UptimeMonitor\Helpers\UptimeResponseCheckers\UptimeResponseChecker here. */ 'response_checker' => Spatie\UptimeMonitor\Helpers\UptimeResponseCheckers\LookForStringChecker::class, /* * An uptime check will be performed if the last check was performed more than the * given number of minutes ago. If you change this setting you have to manually * update the `uptime_check_interval_in_minutes` value of your existing monitors. * * When an uptime check fails we'll check the uptime for that monitor every time `monitor:check-uptime` * runs regardless of this setting. */ 'run_interval_in_minutes' => 5, /* * To speed up the uptime checking process the package can perform the uptime check of several * monitors concurrently. Set this to a lower value if you're getting weird errors * running the uptime check. */ 'concurrent_checks' => 10, /* * The uptime check for a monitor will fail if the url does not respond after the * given number of seconds. */ 'timeout_per_site' => 10, /* * Because networks can be a bit unreliable the package can make three attempts * to connect to a server in one uptime check. You can specify the time in * milliseconds between each attempt. */ 'retry_connection_after_milliseconds' => 100, /* * If you want to change the default Guzzle client behaviour, you can do so by * passing custom options that will be used when making requests. */ 'guzzle_options' => [ // 'allow_redirects' => false, ], /* * Fire `Spatie\UptimeMonitor\Events\MonitorFailed` event only after * the given number of uptime checks have consecutively failed for a monitor. */ 'fire_monitor_failed_event_after_consecutive_failures' => 2, /* * When reaching out to sites this user agent will be used. */ 'user_agent' => 'spatie/laravel-uptime-monitor uptime checker', /* * When reaching out to the sites these headers will be added. */ 'additional_headers' => [], /* * Allow status codes other than 200 to be considered as successful uptime checks. */ 'additional_status_codes' => [], ], 'certificate_check' => [ /* * The `Spatie\UptimeMonitor\Events\SslExpiresSoon` event will fire * when a certificate is found whose expiration date is in * the next number of given days. */ 'fire_expiring_soon_event_if_certificate_expires_within_days' => 10, ], /* * To add or modify behaviour to the Monitor model you can specify your * own model here. The only requirement is that it should extend * `Spatie\UptimeMonitor\Models\Monitor`. */ 'monitor_model' => Spatie\UptimeMonitor\Models\Monitor::class, ];
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
API
Currently this package does not offer an API, if you need that take a look at this package.
Documentation
You'll find the documentation on https://docs.spatie.be/laravel-uptime-monitor. It includes detailed info on how to install and use the package.
Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the uptime monitor? Feel free to create an issue on GitHub, we'll try to address it as soon as possible.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
To run the tests, issue this command:
vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
spatie/laravel-uptime-monitor 适用场景与选型建议
spatie/laravel-uptime-monitor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 261.17k 次下载、GitHub Stars 达 1.07k, 最近一次更新时间为 2016 年 09 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「spatie」 「laravel-uptime-monitor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 spatie/laravel-uptime-monitor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spatie/laravel-uptime-monitor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 spatie/laravel-uptime-monitor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Receive webhooks in Laravel apps
Easily optimize images using PHP
Store your application settings
Add tags and taggable behaviour to your Laravel app
Speed up a Laravel application by caching the entire response additions
A powerful, easy to configure uptime monitor
统计信息
- 总下载量: 261.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1079
- 点击次数: 24
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-09