Suivez les instructions ci-dessous pour configurer ce check lorsque l’Agent est exécuté sur un host. Consultez la section Environnement conteneurisé pour la configuration dans un environnement conteneurisé.
init_config:instances:## @param status_url - string - required## Get metrics from your FPM pool with this URL## The status URLs should follow the options from your FPM pool## See http://php.net/manual/en/install.fpm.configuration.php## * pm.status_path## You should configure your fastcgi passthru (nginx/apache) to catch these URLs and## redirect them through the FPM pool target you want to monitor (FPM `listen`## directive in the config, usually a UNIX socket or TCP socket.#- status_url:http://localhost/status## @param ping_url - string - required## Get a reliable service check of your FPM pool with `ping_url` parameter## The ping URLs should follow the options from your FPM pool## See http://php.net/manual/en/install.fpm.configuration.php## * ping.path## You should configure your fastcgi passthru (nginx/apache) to## catch these URLs and redirect them through the FPM pool target## you want to monitor (FPM `listen` directive in the config, usually## a UNIX socket or TCP socket.#ping_url:http://localhost/ping## @param use_fastcgi - boolean - required - default: false## Communicate directly with PHP-FPM using FastCGI#use_fastcgi:false## @param ping_reply - string - required## Set the expected reply to the ping.#ping_reply:pong
Il est possible de surveiller plusieurs pools PHP-FPM avec le même serveur proxy, ce qui est particulièrement utile si vous utilisez Kubernetes. Pour ce faire, modifiez les itinéraires de votre serveur de façon à les rediriger vers chacune de vos instances PHP-FPM. Voici un exemple de configuration NGINX :
Si cette méthode est trop fastidieuse à grande échelle, définissez use_fastcgi sur true pour obliger le check à ignorer les serveurs proxy et à communiquer directement avec PHP-FPM en utilisant FastCGI. Lorsqu’aucun port n’est précisé dans les paramètres status_url et ping_url, il est défini par défaut sur 9000.
Si votre installation PHP-FPM utilise des sockets Unix, vous devez activer use_fastcgi et appliquer la syntaxe ci-dessous pour status_url et ping_url :
Paramètre
Valeur
status_url
unix:///<CHEMIN_FICHIER>.sock/status
ping_url
unix:///<CHEMIN_FICHIER>.sock/ping
ping_reply
pong
use_fastcgi
true
Remarque : avec Autodiscovery, si l’Agent s’exécute dans un conteneur, une tâche ou un pod distinct, il ne peut pas accéder au fichier de sockets Unix de votre pool FPM. Pour y remédier, exécutez l’Agent en tant que sidecar.