PHP-FPM Status template
Moderators: Developers, Moderators
PHP-FPM Status template
get_php_fpm_status.pl copy to ../scripts directory
cacti_graph_template_php-fpm_pool_status.xml import to cacti
Script check url http://server:port/phpfpm-status
Thanks for .xml and idea for Alexander Moskalenko
http://forum.nginx.org/read.php?25,1679 ... msg-167900
cacti_graph_template_php-fpm_pool_status.xml import to cacti
Script check url http://server:port/phpfpm-status
Thanks for .xml and idea for Alexander Moskalenko
http://forum.nginx.org/read.php?25,1679 ... msg-167900
- Attachments
-
- cacti-phpfpmstatus.zip
- (3.58 KiB) Downloaded 1761 times
Re: PHP-FPM Status template
I have rewritten your version to be compatible with newer versions of php (5.3.5) (new status message lines were added).
I have rewritten perl part to php.
some minor changes (graph colors and style)
I have rewritten perl part to php.
some minor changes (graph colors and style)
- Attachments
-
- cacti-phpfpm.tar.gz
- (3.53 KiB) Downloaded 946 times
-
- Posts: 1
- Joined: Fri Mar 18, 2011 5:24 pm
Re: PHP-FPM Status template
Thanks for the inspiration guys, unfortunately the template was incompatible with my stable apt-get cacti 0.8.7e installation , so I recreated and restyled the template.
A Template compatible with Cacti 0.8.7e and get_php_fpm_status.php is attached!
A Template compatible with Cacti 0.8.7e and get_php_fpm_status.php is attached!
- Attachments
-
- PHP-FPM-Template.tar
- (21 KiB) Downloaded 844 times
Re: PHP-FPM Status template
My version of this template. It's based on original perl script from 1st post, and xml templates from last reply.
Template created in cacti 0.8.7f under CentOS 5.6.
Template created in cacti 0.8.7f under CentOS 5.6.
- Attachments
-
- cacti-php.png (26.74 KiB) Viewed 17645 times
-
- cacti-php-fpm-statistic.zip
- (3.96 KiB) Downloaded 939 times
Re: PHP-FPM Status template
Hi guys,
I'm trying to get one of these templates working and I get connection errors.
Any ideas how I could fix them?
Can't locate FCGI/Client.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/share/cacti/scripts/get_php_fpm_status.pl line 21.
OR
/usr/bin/perl /usr/share/cacti/scripts/get_php_fpm_status.pl -H 192.168.0.2 -s /phpfpm-status -p 9000
Can't locate object method "new" via package "LWP::UserAgent" at /usr/share/cacti/scripts/get_php_fpm_status.pl line 25.
I'm trying to get one of these templates working and I get connection errors.
Any ideas how I could fix them?
Can't locate FCGI/Client.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/share/cacti/scripts/get_php_fpm_status.pl line 21.
OR
/usr/bin/perl /usr/share/cacti/scripts/get_php_fpm_status.pl -H 192.168.0.2 -s /phpfpm-status -p 9000
Can't locate object method "new" via package "LWP::UserAgent" at /usr/share/cacti/scripts/get_php_fpm_status.pl line 25.
Re: PHP-FPM Status template
I forgot to mention that I use Nginx as web server, on CentOS 5.6 x64.
Re: PHP-FPM Status template
Did you install these Perl modules?TECK wrote:Can't locate FCGI/Client.pm ...
Can't locate object method "new" via package "LWP::UserAgent" ...
How to check:
% perl -MFCGI::Client -e '' (single quote x2)
% perl -MLWP::UserAgent -e ''
It is installed if nothing printed.
Re: PHP-FPM Status template
Please note that upgrading to PHP 5.3.8 will break this template.
Output of php-fpm status changes from:
pool: www
process manager: dynamic
accepted conn: 9078552
listen queue len: 0
max listen queue len: 128
idle processes: 299
active processes: 1
total processes: 300
max children reached: 1
to:
pool: www
process manager: dynamic
start time: 24/Aug/2011:02:35:12 -0700
start since: 3481
accepted conn: 78464
listen queue: 0
max listen queue: 1
listen queue len: 128
idle processes: 109
active processes: 1
total processes: 110
max active processes: 15
max children reached: 0
Changes that you need to make to the get_php_fpm_status.pl script are as follows:
You simply need to update the line markers for the $content[] array:
I've attached the patched perl script.
Output of php-fpm status changes from:
pool: www
process manager: dynamic
accepted conn: 9078552
listen queue len: 0
max listen queue len: 128
idle processes: 299
active processes: 1
total processes: 300
max children reached: 1
to:
pool: www
process manager: dynamic
start time: 24/Aug/2011:02:35:12 -0700
start since: 3481
accepted conn: 78464
listen queue: 0
max listen queue: 1
listen queue len: 128
idle processes: 109
active processes: 1
total processes: 110
max active processes: 15
max children reached: 0
Changes that you need to make to the get_php_fpm_status.pl script are as follows:
You simply need to update the line markers for the $content[] array:
I've attached the patched perl script.
- Attachments
-
- get_php_fpm_status.pl
- (1.29 KiB) Downloaded 1236 times
Re: PHP-FPM Status template
Sorry for the dummy question, so What is PHP-FPM ?
We can have information about this and the job do by this template ?
Thanks a lot
We can have information about this and the job do by this template ?
Thanks a lot
Cacti Version - 0.8.8a
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Plugin Architecture - 3.1
Poller Type - spine
Server Info - Linux
Web Server - Apache/2.2.22 (Ubuntu)
PHP - 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli)
MySQL - 5.5.29-0ubuntu0.12.04.2
RRDTool - 1.4.7
Re: PHP-FPM Status template
Hello everyone,
inspired by this template I create other PHP-FPM statistics without need of web server. Why ?
1. My php and web servers are usually different machines and I want graphs to be associated with every machine, not a web server
2. I usually use several PHP-FPM ports on one machine and I want to monitor them all (it was difficult to describe different virtual host for every machine/port)
3. I just wanted to do it
So I modified one nagios script that monitor PHP-FPM and make it useful with cacti. Perl script requires FCGI::Client module:
http://search.cpan.org/~tokuhirom/FCGI- ... /Client.pm
Copy cacti_check_php-fpm.pl to cacti scripts directory and import .xml template. Allow cacti server to connect to PHP-FPM server in your php-fpm.conf . Create new graphs.
This is my first cacti template, so if I miss something, let me know.
p.s. it should work with php 5.3.8 (I've tested it with 5.3.6)
inspired by this template I create other PHP-FPM statistics without need of web server. Why ?
1. My php and web servers are usually different machines and I want graphs to be associated with every machine, not a web server
2. I usually use several PHP-FPM ports on one machine and I want to monitor them all (it was difficult to describe different virtual host for every machine/port)
3. I just wanted to do it
So I modified one nagios script that monitor PHP-FPM and make it useful with cacti. Perl script requires FCGI::Client module:
http://search.cpan.org/~tokuhirom/FCGI- ... /Client.pm
Copy cacti_check_php-fpm.pl to cacti scripts directory and import .xml template. Allow cacti server to connect to PHP-FPM server in your php-fpm.conf . Create new graphs.
This is my first cacti template, so if I miss something, let me know.
p.s. it should work with php 5.3.8 (I've tested it with 5.3.6)
- Attachments
-
- cacti-php-fpm.tar.gz
- Cacti PHP-FPM fastcgi statistics
- (4.67 KiB) Downloaded 874 times
Re: PHP-FPM Status template
i've imported the HTTP based template to github and made some changes
https://github.com/glensc/cacti-template-php-fpm
it supports polling over HTTP and over FCGI.
https://github.com/glensc/cacti-template-php-fpm
it supports polling over HTTP and over FCGI.
Re: PHP-FPM Status template
hi i install this but not workglen wrote:i've imported the HTTP based template to github and made some changes
https://github.com/glensc/cacti-template-php-fpm
it supports polling over HTTP and over FCGI.
Code: Select all
GET http://127.0.0.1:80'/status'?'': Can't connect to 127.0.0.1:80':80 (Bad hostname) at /home/d0/www/vhosts/ion.widax.ru/docroot/cacti/scripts/get_php_fpm_status.pl line 71.
Code: Select all
pool: www
process manager: ondemand
start time: 13/Aug/2013:12:14:12 +0400
start since: 10526
accepted conn: 1248
listen queue: 0
max listen queue: 1
listen queue len: 128
idle processes: 0
active processes: 1
total processes: 1
max active processes: 6
max children reached: 0
slow requests: 0
Re: PHP-FPM Status template
The host name is wrong. I've not looked at the template so I can't say whether it is the template or your settings, but it is trying to connect to 127.0.0.1:80':80 instead of 127.0.0.1:80.The ustas wrote: hi i install this but not workCode: Select all
GET http://127.0.0.1:80'/status'?'': Can't connect to 127.0.0.1:80':80 (Bad hostname) at /home/d0/www/vhosts/ion.widax.ru/docroot/cacti/scripts/get_php_fpm_status.pl line 71.
Re: PHP-FPM Status template
i download this template at https://github.com/glensc/cacti-template-php-fpmdreads wrote:The host name is wrong. I've not looked at the template so I can't say whether it is the template or your settings, but it is trying to connect to 127.0.0.1:80':80 instead of 127.0.0.1:80.The ustas wrote: hi i install this but not workCode: Select all
GET http://127.0.0.1:80'/status'?'': Can't connect to 127.0.0.1:80':80 (Bad hostname) at /home/d0/www/vhosts/ion.widax.ru/docroot/cacti/scripts/get_php_fpm_status.pl line 71.
Re: PHP-FPM Status template
The template worked fine for me, I would say that you have a typo in your data somewhere. At a Guess I would say you have '/status' in the "Path to status URI" field. Try changing it to /status (so get rid of the single quotes).The ustas wrote:i download this template at https://github.com/glensc/cacti-template-php-fpmdreads wrote:The host name is wrong. I've not looked at the template so I can't say whether it is the template or your settings, but it is trying to connect to 127.0.0.1:80':80 instead of 127.0.0.1:80.The ustas wrote: hi i install this but not workCode: Select all
GET http://127.0.0.1:80'/status'?'': Can't connect to 127.0.0.1:80':80 (Bad hostname) at /home/d0/www/vhosts/ion.widax.ru/docroot/cacti/scripts/get_php_fpm_status.pl line 71.
Who is online
Users browsing this forum: No registered users and 2 guests