Laravel-uptime-monitor 是一個功能強大、易於設定的正常運作時間監視器。當您的網站關閉時(以及恢復時),它會通知您。您也可以在某個網站上的 SSL 憑證到期前幾天收到通知。在底層,該套件利用 Laravel 原生通知,因此可以輕鬆使用 Slack、Telegram 或您首選的通知提供者。
您可以在 [https://spatie.be/docs/laravel-uptime-monitor] 上找到大量文件。它包含有關如何安裝和使用該套件的詳細資訊。
如果您不熟悉 Laravel,但仍想使用我們的正常運行時間監視器,請查看 uptime-monitor-app 儲存庫,其中包含此軟體包的獨立版本。
閱讀此套件的設定檔是快速了解laravel-uptime-monitor
功能的好方法。這是設定檔的內容:
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 ' => [ ' [email protected] ' ],
],
' 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 SpatieUptimeMonitorHelpersUptimeResponseCheckersUptimeResponseChecker 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 `SpatieUptimeMonitorEventsMonitorFailed` 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 `SpatieUptimeMonitorEventsSslExpiresSoon` 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
* `SpatieUptimeMonitorModelsMonitor`.
*/
' monitor_model ' => Spatie UptimeMonitor Models Monitor::class,
];
我們投入了大量資源來創建一流的開源套件。您可以透過購買我們的一款付費產品來支持我們。
我們非常感謝您從家鄉寄給我們一張明信片,並註明您正在使用我們的哪種套餐。您可以在我們的聯絡頁面上找到我們的地址。我們在虛擬明信片牆上發布所有收到的明信片。
目前此套件不提供 API,如果您需要,請查看此套件。
您可以在 https://docs.spatie.be/laravel-uptime-monitor 上找到該文件。它包含有關如何安裝和使用該套件的詳細資訊。
發現自己在使用該包時陷入困境?發現錯誤?您對改進正常運作時間監視器有一般性問題或建議嗎?請隨意在 GitHub 上建立問題,我們將盡力盡快解決它。
請參閱變更日誌以了解最近變更的更多資訊。
若要執行測試,請發出以下命令:
vendor/bin/phpunit
詳細資訊請參閱貢獻。
如果您發現有關安全的錯誤,請發送郵件至 [email protected],而不是使用問題追蹤器。
麻省理工學院許可證 (MIT)。請參閱許可證文件以獲取更多資訊。