[ZBX-18468] Template App PHP-FPM by Zabbix agent Ping item Created: 2020 Oct 08  Updated: 2024 Apr 10  Resolved: 2021 Jan 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 5.0.4
Fix Version/s: 5.0.8rc1, 5.2.4rc1, 5.4.0alpha1, 5.4 (plan)

Type: Problem report Priority: Trivial
Reporter: Maksim Astapenko Assignee: Maxim Chudinov (Inactive)
Resolution: Fixed Votes: 1
Labels: PHP-FPM
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 8 x64 Zabbix server 5.0.4


Attachments: PNG File Снимок экрана 2020-10-08 в 14.24.31.png     PNG File Снимок экрана 2020-10-08 в 14.24.40.png     PNG File Снимок экрана 2020-12-21 в 13.38.37.png    
Team: Team INT
Sprint: Sprint 72 (Jan 2021)
Story Points: 1

 Description   

Steps to reproduce:

  1. Template App PHP-FPM by Zabbix agent latest
  2. Ping item not work
  3. Screens attached
  4. On server get right pong by [root@web ~]# curl -L 127.0.0.1/ping
    pong[root@web ~]

Result:
On test in gui zabbix get response:

4

pong

0

Test on many servers with nginx and apache
Expected:
Worked Template App PHP-FPM by Zabbix agent



 Comments   
Comment by Dragan Janjusevic [ 2020 Dec 20 ]

Took me few hours to nail it

Error is in Preprocessing rule for dependent item:

PHP-FPM: Get Ping page: PHP-FPM: Ping

with key php-fpm.ping.

Preprocessing regexp parameter for that item should read:

{$PHP_FPM.PING.REPLY}

instead of

{$PHP_FPM.PING.REPLY}$

I suppose it's because /ping page returns "0" at the end so regexp with "$" at the end never matches.

Comment by Maksim Astapenko [ 2020 Dec 21 ]

When the command is called curl -L 127.0.0.1/ping run on the server, it does not return "0", there is not even a line feed, only the word pong

Comment by Oleg Gawriloff [ 2020 Dec 26 ]

Yes. But running master item gives us what Dragan shows:

ubuntu@nextcloud:~$ sudo zabbix_get -s nextcloud.managed-it.a1.by -p 10050 --tls-connect psk --tls-psk-identity "nextcloud" --tls-psk-file /etc/zabbix/zabbix_agentd.psk -k web.page.get["localhost","ping","80"]
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-Type: text/plain;charset=UTF-8
Date: Sat, 26 Dec 2020 12:36:10 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Server: nginx/1.14.0 (Ubuntu)
X-Powered-By: PHP/7.3.24-3+ubuntu18.04.1+deb.sury.org+1

4
pong
0
ubuntu@nextcloud:~$

 

Comment by Maxim Chudinov (Inactive) [ 2021 Jan 12 ]

Available in:

Comment by NIKITA [ 2021 Feb 05 ]

I updated the plugin but it still doesn't work for me. The answer is the same

4
pong
0

 

Comment by Maksim Astapenko [ 2021 Jun 02 ]

To make it work, you need to say nginx chunked_transfer_encoding off; http://nginx.org/ru/docs/http/ngx_http_core_module.html#chunked_transfer_encoding

Nginx conf: 

location ~ ^/(status|ping)$ { 
  access_log off; 
  ## Only allow trusted IPs for security, deny everyone else 
  allow 127.0.0.1; 
  deny all; 

  chunked_transfer_encoding off; 

  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;      
  fastcgi_index index.php; 
  include fastcgi_params; 
  fastcgi_pass unix:/run/php-fpm/www.sock; }

Apache config:

<Location /ping>
    Require local
    SetEnv downgrade-1.0
    ProxyPass unix:/run/php-fpm/www.sock|fcgi://localhost/ping
</Location>

 

Comment by Maksim Astapenko [ 2021 Jun 10 ]

For Ubuntu users - https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/420083-bug-report-php-fpm-process-is-not-running

Comment by MASATO HIRAHATA [ 2021 Dec 16 ]

I had a similar problem.

I think it would be desirable to add line "chunked_transfer_encoding off;" to the README.

Generated at Tue Apr 29 10:08:26 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.