定制 uradu/uptime-monitor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

uradu/uptime-monitor

Composer 安装命令:

composer require uradu/uptime-monitor

包简介

Laravel package for uptime monitoring and vendor subscription adjustments

README 文档

README

🚀 Introduction

This package provides automated uptime monitoring for Laravel applications and extends vendor subscriptions based on recorded downtime. It is designed to ensure transparency by tracking platform availability and automatically compensating vendors for any service disruptions.

📦 Installation

You can install this package via Composer:

composer require rudev/uptime-monitor

After installation, publish the configuration file:

php artisan vendor:publish --provider="Rudev\UptimeMonitor\UptimeMonitorServiceProvider"

Run database migrations:

php artisan migrate

🔧 Configuration

The package configuration can be found in config/uptime-monitor.php. You can adjust the settings as needed:

return [
    'check_interval' => 5, // Frequency of uptime checks in minutes
    'notify_admins' => true,
    'notify_vendors' => true,
];

🛠 Usage

Running Uptime Checks

To manually check uptime, run:

php artisan uptime:check

Adjust Vendor Subscriptions Based on Downtime

To extend vendor subscriptions based on downtime, run:

php artisan vendors:adjust-subscriptions

Scheduling Automatic Checks

To automate uptime monitoring, add the following command to your app/Console/Kernel.php:

protected function schedule(Schedule $schedule)
{
    $schedule->command('uptime:check')->everyFiveMinutes();
    $schedule->command('vendors:adjust-subscriptions')->daily();
}

📊 Database Structure

This package creates a platform_uptime table to track uptime status:

Schema::create('platform_uptime', function (Blueprint $table) {
    $table->id();
    $table->enum('status', ['up', 'down']);
    $table->timestamp('downtime_start')->nullable();
    $table->timestamp('downtime_end')->nullable();
    $table->timestamps();
});

🤝 Contribution

If you want to contribute to this project, feel free to fork the repository, make improvements, and submit a pull request.

📄 License

This package is released under the MIT License.

📝 Author

Developed by Radu Ungureanu. For support or suggestions, feel free to open an issue on GitHub.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-07