Setting up integration with monitoring systems (Zabbix, Prometheus) 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1177
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Setting up integration with monitoring systems (Zabbix, Prometheus) for 1C-Bitrix

Site on Bitrix went down Friday evening, and only found out Monday from client email. Classic situation without monitoring. Stock "Performance Monitor" module (perfmon) shows metrics in admin panel, but can't send alerts, build graphs for arbitrary period and integrate with on-call team. For this you need external systems — Zabbix or Prometheus.

What to monitor

Metrics for Bitrix site divide into three levels:

Infrastructure (server):

  • CPU, RAM, disk I/O — basic system metrics
  • Free disk space (Bitrix loves to fill /upload/ and /bitrix/cache/)
  • MySQL/PostgreSQL state: connection count, slow queries, replication lag

Application (Bitrix):

  • Response time of homepage and catalog
  • Error count in /bitrix/modules/main/classes/general/main.php (500 responses)
  • Size of b_event_log and b_cache_tag tables
  • Cron agent status (/bitrix/modules/main/tools/cron_events.php)
  • Mail event queue length (b_event with status 1)

Business (e-commerce):

  • Order count in last hour (sharp drop = problem)
  • Payment errors (payment system log entries)
  • Abandoned cart count

Option 1: Zabbix

Zabbix works via agent on server. For custom Bitrix metrics create script that Zabbix agent calls by schedule.

Script /opt/zabbix-scripts/bitrix_metrics.sh for basic checks:

#!/bin/bash
# HTTP response check
curl -s -o /dev/null -w "%{http_code}" https://example.com/

For metrics from DB — PHP script called via UserParameter in Zabbix agent config:

UserParameter=bitrix.orders.count,php /opt/zabbix-scripts/bitrix_order_count.php
UserParameter=bitrix.cache.size,du -sm /home/bitrix/www/bitrix/cache/ | awk '{print $1}'
UserParameter=bitrix.agents.stuck,php /opt/zabbix-scripts/bitrix_stuck_agents.php

PHP script connects Bitrix core (/bitrix/modules/main/include/prolog_before.php), executes query and returns number to stdout. Zabbix collects value, stores history, builds graphs and sends triggers.

Triggers (examples):

  • HTTP response ≠ 200 for more than 2 minutes → CRITICAL
  • Orders in last hour = 0 (normal > 5) → WARNING
  • Free space < 10% → WARNING, < 5% → CRITICAL
  • Stuck agents (difference NEXT_EXEC and NOW() > 1 hour) → WARNING

Option 2: Prometheus + Grafana

Prometheus works with pull model: queries HTTP endpoint which returns metrics in text format.

Create endpoint /local/metrics/index.php that returns metrics in Prometheus format:

# HELP bitrix_orders_total Total orders count
# TYPE bitrix_orders_total counter
bitrix_orders_total 12345

# HELP bitrix_orders_last_hour Orders in last hour
# TYPE bitrix_orders_last_hour gauge
bitrix_orders_last_hour 17

# HELP bitrix_cache_size_mb Cache directory size in MB
# TYPE bitrix_cache_size_mb gauge
bitrix_cache_size_mb 2048

# HELP bitrix_agents_stuck Number of stuck agents
# TYPE bitrix_agents_stuck gauge
bitrix_agents_stuck 0

Endpoint must be closed from public access: either Basic Auth, or whitelist by IP in nginx, or separate port. Metrics contain sensitive information.

In prometheus.yml add job:

- job_name: 'bitrix'
  scrape_interval: 30s
  static_configs:
    - targets: ['example.com:9100']

Visualization — via Grafana. Dashboard with panels: HTTP latency (graph), orders per hour (stat), errors (alert list), disk space (gauge).

What to choose

Zabbix — if already deployed in company. Supports push and pull, has built-in templates for Linux, MySQL, nginx. Heavier to set up, but more powerful for discovery and event correlation.

Prometheus + Grafana — if infrastructure in Docker/Kubernetes or team prefers cloud-native stack. Easier to start, better visualization, simpler horizontal scaling.

Basic monitoring setup (5-7 metrics, alerts in Telegram/Slack) takes one working day provided Zabbix or Prometheus already deployed.