Magento 2 Server Monitor

Magento 2 Server Monitor

Real-Time Magento 2 Server Monitor Powered by pymonitor Python Agent

Stop guessing. Monitor your store's underlying server health, memory metrics, and running services directly inside the Magento Admin Dashboard[cite: 10, 11]. Built hand-in-hand with the lightweight, secure, and blazing-fast pymonitor Python application[cite: 11, 12].

Core Diagnostic Ecosystem

Securely monitor core Linux services and server hardware directly inside Magento's back-office panel[cite: 11].

Instant CPU, Memory & Load Averages

Review raw, non-obstructive server status metrics[cite: 11]. The Magento panel communicates with the Python API to render real-time CPU usage percentages, used vs. total RAM consumption, and system load averages over 1, 5, and 15-minute intervals[cite: 10, 11, 12]. No command line required.

Complete systemd Monitor Matrix

Pymonitor queries systemd to trace critical servers like Nginx, Apache, MySQL, MariaDB, Redis, Valkey, Elasticsearch, OpenSearch, Cron, and PHP-FPM[cite: 10, 11, 12]. Monitor PIDs, memory foot-print sizes (MB), active runtimes, and auto-restart flags directly on a clean admin status layout[cite: 10, 11, 12].

⚡ Built-in OPcache Tracker: Pymonitor inspects CLI SAPI settings directly, returning active OPcache performance limits, accelerated file counts, and critical php.ini variables in under 200ms[cite: 11, 12]!

Pymonitor Python Prerequisites

Python Version: Python 3.8+[cite: 12]
Supported Linux: Ubuntu, Debian, RHEL / Rocky[cite: 12]
OPcache requirement: php CLI binary must be on path[cite: 12]
**System Permission: **Read access to /proc, and passwordless permission for systemctl status polling[cite: 12]

Supported Service Checks Out-Of-The-Box:
• nginx & Apache Web Server[cite: 12]
• MySQL & MariaDB Database Engines[cite: 12]
• Redis & Valkey In-Memory Stores[cite: 12]
• Elasticsearch & OpenSearch Engines[cite: 12]
• System Cron, PHP-FPM and OPcache[cite: 12]

1.0.0 - Released

  • Adds a Server Monitor page to the Magento admin panel (own top-level menu).
  • Displays system metrics: CPU usage, memory usage, and load average.
  • Displays the status of monitored services (e.g. nginx, Apache, MySQL/MariaDB,
  • Redis/Valkey, Elasticsearch/OpenSearch, cron, PHP-FPM) and PHP OPcache, including uptime, PID, memory consumption, and restart count where available.
  • Lets an admin user manually refresh the data with a single click, without reloading the page.
  • Caches the last known status (via the Magento cache backend) so the page loads instantly, while still allowing an on-demand live refresh.

Frequently Asked Questions

PHP is single-threaded and built to serve web requests, making it notoriously unsafe and slow for scanning Linux processes or polling hardware diagnostics. The pymonitor agent is a standalone Python application that runs smoothly in the background, reading directly from /proc and querying systemd with low latency[cite: 12]. Magento simply reads this secure, cached JSON status block via a lightweight HTTP client API in under 200ms—keeping your server completely secure and fast[cite: 11, 12]!

he module acts as an administrative window inside your Magento backend that communicates directly with a running pymonitor agent instance via HTTP requests. It exposes an entirely independent, top-level Server Monitor dashboard menu to display live performance metrics collected by the agent.

The dashboard breaks down your environment into two distinct sections:

  • System Metrics: Tracks real-time CPU usage percentages, absolute memory usage (used vs. total with precise percentage bars), and system load averages over 1, 5, and 15-minute intervals.
  • Services Status: Monitors key architectural services running your stack (such as Nginx, Apache, MySQL/MariaDB, Redis/Valkey, Elasticsearch/OpenSearch, system cron, and PHP-FPM), displaying their current state, uptime, process IDs (PID), memory footprints, and unexpected restart counts.

No, the module is built with strict performance optimization in mind. The dashboard securely stores the last successfully fetched health state using Magento's native cache backend so that the page loads instantly upon opening. Fresh network requests to the agent are only dispatched based on your configurable Cache TTL threshold (e.g., every 30 seconds) or when manually triggered.

You can click the Refresh button located directly at the top of the dashboard view. This action completely bypasses Magento’s internal status cache and forces an on-demand, live API call directly to the pymonitor agent endpoint to capture current system behavior.

This error highlights a network connectivity failure indicating that Magento cannot connect to the agent. It usually means the pymonitor background service is either not running on the host, is blocked by a local network firewall, or your Pymonitor API URL string inside Magento's store configuration is mistyped.

When operating inside containerized environments, using 127.0.0.1 inside your Magento app settings will fail because it resolves to the container itself rather than the underlying host server. You must bind your host's pymonitor instance to a globally reachable address (like 0.0.0.0 inside its config.json) and configure Magento's Pymonitor API URL to target the host's bridge gateway IP or internal Docker service name.

This error flags an authorization mismatch between the two systems. It means the optional security token typed into Magento's store configurations does not match the secret api_key defined inside your agent's config.json file on the server. Ensure both strings are identical to safely validate endpoints exposed to the network.

To maintain high infrastructure security, access control is governed through Magento's standard ACL (Access Control List) system. User roles must be explicitly granted the WebtechSolutions_ServerMonitor::dashboard privilege to interact with the health charts, while only senior system administrators should hold the WebtechSolutions_ServerMonitor::config privilege to adjust API keys, URLs, and time-out properties.