FPM (FastCGI Process Manager) is an alternative to PHP FastCGI implementation with some additional features (mostly) useful for heavy-loaded sites. php - FPM is one of the most popular open source programming languages on the internet used for web development in platforms such as Magento, WordPress or Drupal.

Prerequisites

  1. Edit the file /etc/nginx/sites-available/default and uncomment the php command lines and place the appropriate socket path to php-fpm socket file as follows:
    location ~ \.php$ 
    {
    include snippets/fastcgi-php.conf;
    #
    # # With php-fpm (or other unix sockets):
    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    # # With php-cgi (or other tcp sockets):
    # fastcgi_pass 127.0.0.1:9000;
    }
    
  2. Add the server status in default nginx file:
    location ~ ^/(status|ping)$ 
    {
        allow 127.0.0.1;
        include fastcgi_params;
        fastcgi_pass   unix:/var/run/php7.2-fpm.sock;
    }
    
  3. For Virtual machines, install the Linux agent.

Configuring the credentials

Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml

phpfpm:
- name: phpfpm
  user: <username>
  pwd: <Password>
  encoding-type: plain
  labels:
    key1: val1
    key2: val2
  

Configuring the application

Virtual machine

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml

- name: php-fpm
  instance-checks:
    service-check:
      - php-fpm
    process-check:
      - php-fpm
    port-check:
      - 80
  

Docker environment

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml

- name: php-fpm
  container-checks:
    image-check:
      - nginx
    port-check:
      - 80
  

Kubernetes environment

Configure the application in config.yaml

- name: php-fpm
  container-checks:
    image-check:
      - nginx
    port-check:
      - 80
  

Validate

Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.

Metrics

OpsRamp MetricMetric Display NameUnitDescription
php_fpm_accepted_connAccepted ConnTotal number of accepted connections
php_fpm_listen_queueListen QueueSize of the socket queue of pending connections
php_fpm_max_listen_queueMax Listen QueueMaximum size of listen queue
php_fpm_listen_queue_lenListen Queue LenTotal number of idle processes
php_fpm_active_processesActive ProcessesTotal number of active processes
php_fpm_total_processesTotal ProcessesTotal number of processes
php_fpm_max_active_processesMax Active ProcessesNumber of times the process limit has been reached
php_fpm_slow_requestsSlow RequestsTotal number of slow requests