WordPress ร— Zabbix

Monitor WordPress
with Zabbix

A full-stack WordPress plugin that exposes 40+ site metrics via a secured REST API and pushes data directly to Zabbix via the Sender protocol โ€” with pre-built graphs, triggers, and a dashboard template.

40+
Metric Items
11
Trigger Rules
6
Pre-built Graphs
8
Metric Groups
Zabbix ยท WordPress Overview
60s
load_time_ms
memory_mb
LIVE
124ms
Load Time
32 MB
Memory
23
DB Queries
Site: UP
OPcache: ON
WP_DEBUG: OFF
Cron: OK
Metric Coverage

40+ Metrics Across 8 Groups

Every metric is exposed via a single REST API call and mapped to a dedicated Zabbix item key. Dependent items extract values from the master JSON payload with zero extra HTTP requests.

โšก
Performance

PHP execution time, memory usage, and WordPress memory limits.

load_time_ms
memory_usage_mb
memory_peak_mb
memory_limit_mb
๐Ÿ—„
Database

Query counts, execution time, slow queries, and database size growth.

query_count
query_time_ms
slow_queries
db_size_mb
autoload_size_kb
๐Ÿ‘ฅ
Users

Registered users, new signups, admin accounts, and active sessions.

total
new_24h
admin_count
active_sessions
๐Ÿ“„
Content

Posts, pages, media library, and comment moderation queue.

published_posts
published_pages
media_files
comments_pending
comments_spam
๐Ÿ”Œ
Plugins

Plugin inventory, update availability, and must-use plugins.

active
inactive
needs_update
mu_plugins
๐Ÿ˜
PHP

PHP version, ini settings, and OPcache efficiency metrics.

version
memory_limit_mb
opcache_enabled
opcache_hit_rate
๐Ÿ’พ
Server

Disk space usage, WP_DEBUG status, and server environment flags.

disk_total_gb
disk_free_gb
disk_used_pct
wp_debug
โฑ
Cron

WP-Cron event counts, overdue jobs, and next scheduled execution.

total_events
overdue_events
next_event_in
Architecture

Built for Production Monitoring

Dual collection modes, a ready-to-import Zabbix template, and a zero-dependency PHP implementation that works on any WordPress 5.9+ installation.

HTTP Agent Pull Mode

Zabbix polls the WordPress REST API using HTTP Agent items. A single master item fetches the full JSON payload; all other items are Dependent Items using JSONPath โ€” one HTTP request per cycle.

Zabbix Sender Push Mode

WordPress pushes metrics to Zabbix via the native Zabbix Sender TCP protocol (port 10051). WP-Cron handles scheduling at configurable intervals from 30 seconds to 1 hour.

Secured REST API

Bearer token authentication with auto-generated 32-character tokens. Optional IP allowlist restricts access to your Zabbix server. Token regeneration available at any time.

Zabbix XML Template

Import-ready XML template for Zabbix 6.0+. Includes 40+ items, 11 triggers with severity levels and dependencies, 6 graphs, and a pre-built WordPress Overview dashboard.

Admin Dashboard Widget

Live metrics widget on the WordPress admin dashboard. Shows performance, database, user, and cron data at a glance with last push status and a direct link to settings.

Configurable Metric Groups

Enable or disable any of the 8 metric groups independently. Disabled groups are excluded from both the REST API response and the Zabbix push payload to reduce overhead.

Installation

Up and Running in Minutes

No agent required on the WordPress server. Just install, configure two macros in Zabbix, and metrics start flowing.

01

Install the Plugin

Upload the plugin ZIP via Plugins โ†’ Add New โ†’ Upload Plugin, or extract the folder to /wp-content/plugins/ and activate.

$ unzip wp-zabbix-monitor.zip -d /var/www/html/wp-content/plugins/
02

Copy Your API Token

Go to Settings โ†’ Zabbix Monitor โ†’ REST API tab. Copy the auto-generated token โ€” you will need it in the Zabbix host macro {$WP_API_TOKEN}.

03

Import the Zabbix Template

In Zabbix: Configuration โ†’ Templates โ†’ Import. Upload the file included in the plugin:

wp-zabbix-monitor/zabbix-template/wordpress-monitoring.xml
04

Create a Zabbix Host

Create a host in Data collection โ†’ Hosts and assign the template WordPress by WP Zabbix Monitor. Set the interface to None (HTTP Agent does not require an agent interface).

05

Set Host Macros

On the host's Macros tab, add:

{$WP_URL} = https://example.com
{$WP_API_TOKEN} = your-token-here
06

(Optional) Enable Push Mode

Under Zabbix Connection tab, enter your Zabbix server hostname and port, set the host name to match Zabbix, enable Push Metrics, and choose a push interval. WordPress will push via TCP port 10051 using WP-Cron.

REST API

Zabbix HTTP Agent Integration

The REST API is the backbone of pull-mode monitoring. Zabbix's HTTP Agent item type polls the endpoint and the master item's JSON is parsed by dependent items using JSONPath.

Endpoints

GET
/wp-json/wpzm/v1/ping
Health check. Returns plugin version and server timestamp.No auth
GET
/wp-json/wpzm/v1/metrics
Full metrics payload for all enabled groups.
GET
/wp-json/wpzm/v1/metrics?groups=performance,database
Filtered payload โ€” only the specified groups.
GET
/wp-json/wpzm/v1/metrics/{group}
Single metric group by name.

Authentication

Pass the API token as a Bearer header or ?token= query parameter:

curl -H "Authorization: Bearer <your-token>" \ "https://example.com/wp-json/wpzm/v1/metrics"

Example Response

200 OKapplication/json
GET /wp-json/wpzm/v1/metrics
{
"timestamp": 1704067200,
"site_url": "https://example.com",
"wp_version": "6.4.2",
"performance": {
"load_time_ms": 124.5,
"memory_usage_mb": 32.4,
"memory_peak_mb": 38.1,
"memory_limit_mb": 256,
"wp_memory_limit_mb": 256
},
"database": {
"query_count": 23,
"query_time_ms": 18.3,
"slow_queries": 0,
"db_size_mb": 45.2,
"autoload_size_kb": 312.8
},
"users": {
"total": 1482,
"new_24h": 7,
"admin_count": 2,
"active_sessions": 34
},
"plugins": {
"active": 18,
"inactive": 3,
"needs_update": 2,
"mu_plugins": 1
}
}
โšก Auto-Provision

One-Click Zabbix Host Setup

Skip the manual host creation entirely. The Auto-Provision tab uses the Zabbix JSON-RPC API to create your host, assign the template, and configure all macros โ€” directly from the WordPress admin panel.

01

Import the Zabbix Template

Before provisioning, import the bundled XML template into Zabbix via Configuration โ†’ Templates โ†’ Import. The provisioner looks up the template by name โ€” it must already exist.

02

Open the Auto-Provision Tab

In your WordPress admin, go to Settings โ†’ Zabbix Monitor โ†’ โšก Auto-Provision. Enter your Zabbix frontend URL (ending in /api_jsonrpc.php), username, and password.

03

Test the API Connection

Click Test API Connection. The plugin authenticates with the Zabbix JSON-RPC API and returns the API version. Credentials are never stored in the database.

04

Provision the Host

Click Provision Host in Zabbix. The plugin creates (or updates) the host, assigns the template, and sets {$WP_URL} and {$WP_API_TOKEN} macros automatically. Done.

What Happens Under the Hood

๐Ÿ”
Authenticates
Calls user.login via JSON-RPC and obtains a session token. Token is used only for the provisioning request and immediately invalidated with user.logout.
๐Ÿ“
Creates Host Group
Calls hostgroup.get to find "WordPress Sites" (or your custom group name). If not found, calls hostgroup.create automatically.
๐Ÿ”
Resolves Template
Calls template.get to find the imported template by exact name. Returns a clear error if the template hasn't been imported yet.
๐Ÿ–ฅ
Creates or Updates Host
Calls host.get to check for an existing host by display name. Creates a new host with host.create or updates the existing one with host.update.
โš™๏ธ
Sets All Macros
Sets {$WP_URL}, {$WP_API_TOKEN}, and all threshold macros ({$WP_LOAD_TIME_HIGH}, {$WP_DISK_WARN}, etc.) with sensible defaults that match the template triggers.
๐Ÿšช
Logs Out
Calls user.logout to invalidate the session token. Your Zabbix credentials are never written to the WordPress database.
Zabbix JSON-RPC API Call SequencePOST /api_jsonrpc.php
1.user.loginโ†’Authenticate, receive auth token
2.apiinfo.versionโ†’Verify API version (test connection only)
3.hostgroup.getโ†’Find host group by name
4.hostgroup.createโ†’Create group if not found
5.template.getโ†’Resolve template ID by name
6.host.getโ†’Check for existing host
7.host.createโ†’Create new host (if not exists)
8.host.updateโ†’Update existing host (if found)
9.user.logoutโ†’Invalidate session token
๐Ÿ”’
Security Note

Your Zabbix password is transmitted over HTTPS directly to the Zabbix API and is never written to the WordPress database. Only the API URL, username, host name, and host ID are stored for display purposes. Always use HTTPS for your Zabbix frontend and enable SSL verification in the plugin settings.

๐Ÿ›’ WOOCOMMERCE

WooCommerce Store Metrics

Version 1.2.0 adds a dedicated WooCommerce metrics group with 22 store-level data points across orders, revenue, cart abandonment, inventory, customers, and reviews. The group is automatically skipped when WooCommerce is not active, so the plugin remains safe to install on any WordPress site.

โšก

HPOS-aware: The collector automatically detects WooCommerce High-Performance Order Storage (HPOS, available since WooCommerce 7.1) and queries the wc_orders table when enabled. It falls back to the classic wp_posts table on older installations. All queries are read-only and use a 5-minute transient cache to avoid adding latency to push cycles.

Metric Groups

Zabbix Item KeyLabelTypeDescription
wordpress.woocommerce.orders_total_todayOrders TodayUNSIGNEDOrders placed in the last 24 h
wordpress.woocommerce.orders_total_weekOrders This WeekUNSIGNEDOrders placed in the last 7 days
wordpress.woocommerce.orders_per_hourOrders / HourUNSIGNEDRolling 1-hour order rate
wordpress.woocommerce.orders_pendingPending OrdersUNSIGNEDOrders with status pending
wordpress.woocommerce.orders_processingProcessing OrdersUNSIGNEDOrders with status processing
wordpress.woocommerce.orders_failedFailed OrdersUNSIGNEDOrders with status failed
wordpress.woocommerce.orders_refundedRefunded OrdersUNSIGNEDOrders with status refunded
wordpress.woocommerce.orders_cancelledCancelled OrdersUNSIGNEDOrders with status cancelled

5 New Triggers

High number of failed ordersWARNING
{$WP_WC_FAILED_ORDERS_WARN}default: 5
High number of pending ordersWARNING
{$WP_WC_PENDING_ORDERS_WARN}default: 20
Multiple products out of stockWARNING
{$WP_WC_OUT_OF_STOCK_WARN}default: 5
Multiple products below low-stock thresholdINFO
{$WP_WC_LOW_STOCK_WARN}default: 3
High abandoned cart countINFO
{$WP_WC_ABANDONED_CARTS_WARN}default: 50

2 New Graphs

WooCommerce: Sales Overview
orders_total_today (left)
revenue_today (right)
orders_failed (left)
WooCommerce: Inventory Status
products_low_stock (left)
products_out_of_stock (left)
cart_abandoned_sessions (right)
REST API Response โ€” woocommerce groupGET /wp-json/wpzm/v1/metrics
{
  "timestamp": 1742400000,
  "site_url": "https://example.com",
  "woocommerce": {
    "orders_total_today":      14,
    "orders_total_week":       87,
    "orders_per_hour":          2,
    "orders_pending":           3,
    "orders_processing":        8,
    "orders_failed":            1,
    "orders_refunded":          0,
    "orders_cancelled":         2,
    "revenue_today":         1284.50,
    "revenue_week":          7920.00,
    "revenue_avg_order":       91.03,
    "cart_abandoned_sessions":  22,
    "products_total":          348,
    "products_out_of_stock":     4,
    "products_low_stock":        7,
    "products_backorders":       2,
    "customers_total":        1204,
    "customers_new_today":       3,
    "coupons_total":            18,
    "reviews_pending":           1
  }
}
Zabbix Template

Import-Ready XML Template

The bundled Zabbix 6.0+ template includes all items, triggers with dependency chains, pre-built graphs, and a WordPress Overview dashboard โ€” ready to import in one click.

Items

Master HTTP Agent item
Polls REST API every 60s
1
Ping / availability item
Polls every 30s, no auth
1
Dependent metric items
JSONPath from master
38+
Collection mode
HTTP Agent or Trapper
โ€”

Triggers (11)

HIGHSite is unreachable
HIGHPage load time critical (>3000ms)
WARNPage load time elevated (>1000ms)
WARNSlow database queries detected
WARNHigh database query count
HIGHDisk usage critical (>90%)
WARNDisk usage elevated (>80%)
INFOPlugin updates available
WARNCron events overdue
WARNWP_DEBUG enabled in production
WARNPHP OPcache is disabled

Graphs (6)

Performance Overview
load_time_msmemory_usage_mb
Database Activity
query_countquery_time_msslow_queries
User Growth
users.totalusers.new_24h
Disk Usage
disk_used_pctdisk_free_gb
OPcache Hit Rate
opcache_hit_rate
Database Size Growth
db_size_mbautoload_size_kb
๐Ÿ“Š
WordPress Overview Dashboard
Pre-built Zabbix dashboard with all 6 graphs arranged in a 2ร—2 grid. Auto-refreshes every 30 seconds.

Template File Location

# After installing the plugin, the template is at: wp-content/plugins/wp-zabbix-monitor/zabbix-template/wordpress-monitoring.xml # Import via Zabbix UI: Configuration โ†’ Templates โ†’ Import