PHPackages                             vrok/monitoring-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. vrok/monitoring-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

vrok/monitoring-bundle
======================

Symfony bundle to send 'alive' emails to a monitoring address (cron-triggered)

1.5.0(5mo ago)04.3k↓14.3%[1 PRs](https://github.com/j-schumann/monitoring-bundle/pulls)MITPHPPHP ^8.3CI failing

Since Aug 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/j-schumann/monitoring-bundle)[ Packagist](https://packagist.org/packages/vrok/monitoring-bundle)[ Docs](https://vrok.de)[ RSS](/packages/vrok-monitoring-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (13)Used By (0)

Monitoring-Bundle
=================

[](#monitoring-bundle)

Schedule sending email messages from the console to check if cron is running and mails can be sent by the system (e.g. your Docker container running the application). If the Symfony messenger is configured, the messages are pushed to the queue and processed by a worker, so this also checks if queue &amp; workers are up.

[![CI Status](https://github.com/j-schumann/monitoring-bundle/actions/workflows/ci.yaml/badge.svg)](https://github.com/j-schumann/monitoring-bundle/actions)[![Coverage Status](https://camo.githubusercontent.com/57ae4a901ab8175dbfff9968873a3adea1290dd738d7b417f44065024fddadf1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6a2d736368756d616e6e2f6d6f6e69746f72696e672d62756e646c652f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/j-schumann/monitoring-bundle?branch=main)

Installation
------------

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Applications that use Symfony Flex

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require vrok/monitoring-bundle
```

### Applications that don't use Symfony Flex

[](#applications-that-dont-use-symfony-flex)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require vrok/monitoring-bundle
```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    Vrok\MonitoringBundle\VrokMonitoringBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

The Symfony Mailer must be configured and should set a default sender (FROM address) via listener / config.

Create `config/packages/vrok_monitoring.yaml`:

```
vrok_monitoring:
  # receiver of the ping email
  monitor_address: mail@domain.tld

  # application name used in the subject and body of the mail
  app_name: My-App-Name
```

Optionally get this options from the ENV with `'%env(MONITOR_ADDRESS)%'` etc.

Usage
-----

[](#usage)

Call `bin/console monitor:send-alive-message` from console, best triggered via a cron every 30min etc.:

```
2,32 * * * * www-data /usr/local/bin/php /var/www/html/bin/console monitor:send-alive-message

```

Email subject will be "Service \[app\_name\] is alive!". The text body contains an integer timestamp which is later used by the Icinga check to purge all but the newest message):

```
Automatic message from [app_name]: The service is alive and can send emails
at 2020-09-06T09:02:01+02:00 (timestamp 1599375721)

```

Icinga configuration
--------------------

[](#icinga-configuration)

Retrieval of the sent messages requires the [check\_imap\_receive](http://buhacoff.net/software/check_email_delivery/check_imap_receive.html)Nagios/Icinga plugin, make sure this is installed and working on a server monitored with Icinga, can be the same as the application server but doesn't have to.

Create the check script &amp; replace the mailserver domain, receiver address &amp; password with your values, we don't use arguments for those to not store those credentials on the Icinga master.

`/usr/lib/nagios/plugins/contrib/check_service_alive`:

```
#!/bin/bash
# Delete all but the last "alive" mail
# -s SUBJECT -s "$1" - only with this subject, given in argument $1
# --capture-max "timestamp (\d+)" - extract nummeric value
# --capture-min thisdoesnotexist - required to _not_ capture a minimum message, that would not be deleted otherwise
# --no-delete-captured - we want to delete old messages so the postbox doesn't fill (--delete is enabled by default)
#   but we want to keep the last message so the Nagios check does not fail if he runs e.g. every 15min
#   so with --capture-max and --no-delete-captured we keep the last mail, delete the rest (of emails matching the search)
# no output (1>/dev/null) so Icinga only reads the status from the check below
/usr/lib/nagios/plugins/check_imap_receive -H mail.domain.tld -U receiver@domain.tld -P imap_password --tls -w 5 -c 10 --imap-retries 1 --search-critical-min 1 -s SUBJECT -s "$1" --capture-max "timestamp (\d+)" --capture-min thisdoesnotexist --nodelete-captured 1>/dev/null

# Check if a mail with the given subject was received in the last hour:
# --imap-retries - search only once instead of 10x in 5s intervals
# -s YOUNGER -s 3600 = within the last hour
# -s SUBJECT -s "$1" - only with this subject, given in argument $1
/usr/lib/nagios/plugins/check_imap_receive -H mail.domain.tld -U receiver@domain.tld -P imap_password --tls -w 5 -c 10 --imap-retries 1 --search-critical-min 1 -s YOUNGER -s 3600 -s SUBJECT -s "$1" --nodelete
```

Add the command definition in the Icinga master:

```
// Symfony Service Check (a mail with the given subject was received within the last hour)
object CheckCommand "check_service_alive" {
  command = [ PluginDir + "/contrib/check_service_alive" ]
  arguments = {
    "--subject" = {
      value = "$subject$"
      description = "email subject [substring] to search for"
      required = true
      skip_key = true
    }
  }
}

```

Also the service definition:

```
// Symfony Service Check (a mail with the given subject was received within the last hour)
apply Service for (name => subject in host.vars.service_alive) {
  check_command = "check_service_alive"
  check_interval = 30m
  display_name = name + " service check"
  vars.subject = subject
  assign where host.vars.client_endpoint && host.vars.check_service_alive == true
  command_endpoint = host.vars.client_endpoint
}

```

Finally, enable &amp; configure the service in your host definition, replace "dev.domain.tld" with the *app\_name* you configured in the `packages/vrok_monitoring.yaml`. You can monitor multiple applications with one *monitor\_address*, just make sure the app\_names are different (subject is matched by pattern, so using "domain.tld is alive" and "dev.domain.tld is alive will collide, prefix with "Service " to prevent this):

```
    vars.check_service_alive = true
    vars.service_alive["App-Dev"] = "dev.domain.tld is alive"
    vars.service_alive["App-Prod"] = "Service domain.tld is alive"

```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance80

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 84.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~216 days

Recently: every ~339 days

Total

10

Last Release

159d ago

PHP version history (5 changes)v1.0.0PHP ^7.4

v1.0.2PHP ^7.4|^8.0

1.2.0PHP ^8.0

1.3.0PHP ^8.2

1.4.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed9373b6806c33f512ca3b63214dd2a2b2621bcbddffcdb99acc66ae7f0324aa?d=identicon)[j-schumann](/maintainers/j-schumann)

---

Top Contributors

[![j-schumann](https://avatars.githubusercontent.com/u/114239?v=4)](https://github.com/j-schumann "j-schumann (45 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (5 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (3 commits)")

---

Tags

symfonymonitoringcronmailernagios

###  Code Quality

TestsPHPUnit

Static AnalysisRector

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/vrok-monitoring-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/vrok-monitoring-bundle/health.svg)](https://phpackages.com/packages/vrok-monitoring-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
