okipa/laravel-supervisor-downtime-notifier 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

okipa/laravel-supervisor-downtime-notifier

Composer 安装命令:

composer require okipa/laravel-supervisor-downtime-notifier

包简介

Get notified when supervisor is down.

README 文档

README

Laravel Supervisor Downtime Notifier

Latest Stable Version Total Downloads Build Status Coverage Status License: MIT

Get notified and execute PHP callback when:

  • The supervisor service is not running on your server
  • Your environment supervisor processes are down

Notifications can be sent by mail, Slack and webhooks (chats often provide a webhook API).

Found this package helpful? Please consider supporting my work!

Donate Donate

Compatibility

Laravel version PHP version Package version
^9.0 | ^10.0 8.1.* | 8.2.* ^2.4
^8.0 | ^9.0 ^8.1 | ^8.2 ^2.3
^8.0 | ^9.0 ^8.0 | ^8.1 ^2.2
^7.0 | ^8.0 ^7.4 | ^8.0 ^2.1
^7.0 | ^8.0 ^7.4 ^2.0
^6.0 | ^7.0 ^7.4 ^1.0

Upgrade guide

Table of Contents

Requirements

By default, this package monitors supervisor downtime for projects running on Linux servers.

The user running PHP CLI will execute the following commands:

  • systemctl is-active supervisor
  • supervisorctl status "<your-process-name>"

As so, make sure you give him permission to execute these actions (sudo visudo -f /etc/sudoers.d/<user>):

  • <user> ALL=NOPASSWD:/bin/systemctl is-active supervisor
  • <user> ALL=NOPASSWD:/usr/bin/supervisorctl status *

That being said, you still can use this package for other servers OS by using your own SupervisorChecker class and defining OS-specific commands.

Installation

Install the package with composer:

composer require okipa/laravel-supervisor-downtime-notifier

If you intend to send Slack notifications you will have to install:

composer require laravel/slack-notification-channel

If you intend to send webhook notifications you will have to install:

composer require laravel-notification-channels/webhook

Configuration

Publish the package configuration:

php artisan vendor:publish --tag=supervisor-downtime-notifier:config

Translations

All words and sentences used in this package are translatable.

See how to translate them on the Laravel official documentation: https://laravel.com/docs/localization#using-translation-strings-as-keys.

Here is the list of the words and sentences available for translation by default:

* [:app - :env] supervisor service is not started
* We have detected that the supervisor service is not started on [:app - :env](:url).
* `[:app - :env]` supervisor service is not started on :url.
* Supervisor service is not started.
* {1}[:app - :env] :count supervisor down process has been detected|[2,*][:app - :env] :count supervisor down processes have been detected
* {1}We have detected :count supervisor down process on [:app - :env](:url): ":processes".|[2,*]We have detected :count supervisor down processes on [:app - :env](:url): ":processes".
* Please check your down processes connecting to your server and executing the "supervisorctl status" command.
* {1}`[:app - :env]` :count supervisor down process has been detected on :url: ":processes".|[2,*]`[:app - :env]` :count supervisor down processes have been detected on :url: ":processes".
* {1}:count supervisor down process has been detected: ":processes".|[2,*]:count supervisor down processes have been detected: ":processes".
* Notification test:
* Exception test:

Usage

Just add this command in the schedule() method of your \App\Console\Kernel class:

$schedule->command('supervisor:downtime:notify')->everyFifteenMinutes();

And you will be notified if your supervisor service is not running, or if your environment supervisor processes are down when the command will be executed.

Once everything has been set up, you can check if the configuration is correct by simulating supervisor processes downtime:

php artisan supervisor:downtime:simulate

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 8.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固