magewatch/module-agent 问题修复 & 功能扩展

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

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

magewatch/module-agent

Composer 安装命令:

composer require magewatch/module-agent

包简介

Read-only monitoring agent for Magento 2 that collects health metrics and pushes them to the MageWatch SaaS API.

README 文档

README

Read-only monitoring agent for Magento 2.4.6+. Collects indexers, cron, queues, orders, logs, and system metrics every 5 minutes and POSTs a JSON heartbeat to MageWatch.

Requirements

  • Magento 2.4.6+ (Open Source or Adobe Commerce)
  • PHP 8.1, 8.2, or 8.3

Installation

From Packagist (recommended)

From your Magento project root:

composer require magewatch/module-agent
bin/magento module:enable MageWatch_Agent
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Before Packagist indexes the repo (or for private mirrors)

Add the GitHub VCS repository to your Magento composer.json, then require the package:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/krivtsuna/magewatch-module-agent"
        }
    ]
}
composer require magewatch/module-agent:^1.0
bin/magento module:enable MageWatch_Agent
bin/magento setup:upgrade
bin/magento cache:flush

Local monorepo development (path repository)

{
    "repositories": [
        {
            "type": "path",
            "url": "../magewatch.io/packages/magewatch-module-agent",
            "options": { "symlink": true }
        }
    ],
    "require": {
        "magewatch/module-agent": "@dev"
    }
}

Configuration

Stores → Configuration → MageWatch → Agent

Field Description
Enabled Turns the cron job on/off
API Endpoint URL HTTPS ingest URL, e.g. https://magewatch.io/api/v1/ingest
Site Token Bearer token from the MageWatch dashboard
Stuck Cron Threshold Minutes before a running job is reported as stuck (default 30)

CLI

bin/magento magewatch:status
bin/magento magewatch:send
bin/magento magewatch:send --force

How it works

  • Cron group magewatch runs CollectAndSend on a configurable schedule (default */5 * * * *).
  • Collectors implement CollectorInterface; failures are logged and listed in collector_errors without breaking the run.
  • Delivery uses Magento's Curl client (TLS verification on, 5s connect / 10s total timeout).
  • Log line deltas use the magewatch_log_offset DB table (multi-node safe).

Tests

Unit tests run inside a Magento dev environment:

vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/MageWatch/Agent/Test/Unit

In this standalone repo (requires Magento packages in vendor/):

composer install
vendor/bin/phpunit

Uninstall

bin/magento module:disable MageWatch_Agent
composer remove magewatch/module-agent
bin/magento setup:upgrade

License

OSL-3.0 — see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2026-07-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固