Group health checks by environment
2.xYou can organize checks into groups (e.g., default, cron, app_server) to run only relevant checks in specific environments.
1. Define groups for built-in checks
In your config.yml:
liip_monitor:
default_group: default
checks:
groups:
default:
php_extensions: [apc, xdebug]
cron:
php_extensions: [redis]2. Define groups for custom tagged services
Add the group attribute to the service tag:
services:
monitor.check.php_extensions:
class: Acme\HelloBundle\Check\PhpExtensionsCheck
tags:
- { name: liip_monitor.check, alias: php_extensions, group: cron }
- { name: liip_monitor.check, alias: php_extensions, group: app_server }Note: If using autoconfigure, you must set autoconfigure: false to manually assign groups via tags.
3. Execute specific groups via CLI
Use the --group option:
bin/console monitor:health --group=app_serverUse --all to run all checks across all groups.