Skip to content

Commit

Permalink
Merge pull request #23 from valekrus/new_config
Browse files Browse the repository at this point in the history
new_description
  • Loading branch information
hermzz committed May 23, 2016
2 parents 3e9d2ac + db3e5b5 commit ad0c851
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 59 deletions.
62 changes: 41 additions & 21 deletions phpfpm_average
@@ -1,21 +1,41 @@
#!/bin/sh
# -*- sh -*-
#
# Plugin to monitor the average process size of PHP5-FPM on the machine.
#
# Copyright TJ Stein 2010 http://constantshift.com
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=manual
#%# capabilities=autoconf

PHP_BIN=${phpbin-"php5-fpm"}

: <<=cut
=head1 NAME
phpfpm_average - Munin plugin to monitor the average process size of PHP-FPM on the machine.
=head1 CONFIGURATION
You might need to specify connection parameters in the plugin
configuration to override the defaults. These are the defaults:
[phpfpm_*]
env.phpbin php-fpm
env.phppool www
=head1 PARAMETERS:
config (required)
autoconf (optional - used by munin-config)
=over
=head1 LICENSE
Copyright TJ Stein 2010 http://constantshift.com
=head1 MAGICK MARKERS
#%# family=manual
#%# capabilities=autoconf
=cut


PHP_BIN=${phpbin-"php-fpm"}
PHP_POOL=${phppool-"www"}

if [ "$1" = "autoconf" ]; then
Expand All @@ -24,14 +44,14 @@ exit 0
fi

if [ "$1" = "config" ]; then
echo 'graph_title PHP5-FPM Average Process Size'
echo 'graph_title PHP-FPM Average Process Size'
echo 'graph_args --base 1024 -l 0 '
echo 'graph_vlabel PHP5-FPM Average Process Size'
echo 'graph_vlabel PHP-FPM Average Process Size'
echo 'graph_category PHP'
echo 'graph_info This graph shows the average process size for PHP5-FPM'
echo 'php_average.label PHP5-FPM Average Proccess Size'
echo 'graph_info This graph shows the average process size for PHP-FPM'
echo 'php_average.label PHP-FPM Average Proccess Size'
echo 'php_average.draw LINE2'
echo 'php_average.info The average process size for PHP5-FPM'
echo 'php_average.info The average process size for PHP-FPM'
exit 0
fi

Expand Down
47 changes: 42 additions & 5 deletions phpfpm_connections
@@ -1,8 +1,45 @@
#!/usr/bin/perl
#
# Magic markers:
#%# family=auto
#%# capabilities=autoconf
# -*- perl -*-

=encoding utf8
=head1 NAME
phpfpm_connections - Munin plugin to monitor the number of accepted connections to PHP-FPM.
=head1 CONFIGURATION
For this plugin, you will need to enable the status feature
included in versions 5.3.2+ of PHP-FPM. The directive can be
found in the php-fpm.conf file:
pm.status_path = /status
You might need to specify connection parameters in the plugin
configuration to override the defaults. These are the defaults:
[phpfpm_*]
env.url http://127.0.0.1/status
env.ports 80
=head1 PARAMETERS:
config (required)
autoconf (optional - used by munin-config)
=over
=head1 LICENSE
Copyright TJ Stein 2010 http://constantshift.com
=head1 MAGICK MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut


my $ret = undef;

Expand Down Expand Up @@ -41,7 +78,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )

if ( defined $ARGV[0] and $ARGV[0] eq "config" )
{
print('graph_title PHP5-FPM Accepted Connections
print('graph_title PHP-FPM Accepted Connections
graph_args --base 1024 -l 0
graph_vlabel Connections
graph_category PHP
Expand Down
51 changes: 44 additions & 7 deletions phpfpm_memory
@@ -1,14 +1,51 @@
#!/usr/bin/env perl
#
# Munin plugin for monitoring PHP5-FPM memory usage
#
# Copyright TJ Stein 2010 http://constantshift.com
#!/usr/bin/perl
# -*- perl -*-

my $PHP_BIN = exists $ENV{'phpbin'} ? $ENV{'phpbin'} : "php5-fpm";
=encoding utf8
=head1 NAME
phpfpm_connections - Munin plugin for monitoring PHP-FPM memory usage.
=head1 CONFIGURATION
You might need to specify connection parameters in the plugin
configuration to override the defaults. These are the defaults:
[phpfpm_*]
env.phpbin php-fpm
env.phppool www
=head1 PARAMETERS:
config (required)
autoconf (optional - used by munin-config)
=over
=head1 LICENSE
Copyright TJ Stein 2010 http://constantshift.com
=head1 MAGICK MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut


my $PHP_BIN = exists $ENV{'phpbin'} ? $ENV{'phpbin'} : "php-fpm";
my $PHP_POOL = exists $ENV{'phppool'} ? $ENV{'phppool'} : "www";

if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )
{
print "yes\n";
exit 0;
}

if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
print "graph_title PHP5-FPM Memory Usage\n";
print "graph_title PHP-FPM Memory Usage\n";
print "graph_vlabel RAM\n";
print "graph_category PHP\n";
print "ram.label ram\n";
Expand Down
61 changes: 40 additions & 21 deletions phpfpm_processes
@@ -1,21 +1,40 @@
#!/bin/sh
# -*- sh -*-
#
# Plugin to monitor the number of PHP5-FPM processes on the machine.
#
# Copyright TJ Stein 2010 http://constantshift.com
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# Magick markers (optional - used by munin-config and som installation
# scripts):
#%# family=manual
#%# capabilities=autoconf

PHP_BIN=${phpbin-"php5-fpm"}

: <<=cut
=head1 NAME
phpfpm_average - Munin plugin to monitor the number of PHP5-FPM processes on the machine.
=head1 CONFIGURATION
You might need to specify connection parameters in the plugin
configuration to override the defaults. These are the defaults:
[phpfpm_*]
env.phpbin php-fpm
env.phppool www
=head1 PARAMETERS:
config (required)
autoconf (optional - used by munin-config)
=over
=head1 LICENSE
Copyright TJ Stein 2010 http://constantshift.com
=head1 MAGICK MARKERS
#%# family=manual
#%# capabilities=autoconf
=cut

PHP_BIN=${phpbin-"php-fpm"}
PHP_POOL=${phppool-"www"}

if [ "$1" = "autoconf" ]; then
Expand All @@ -24,14 +43,14 @@ exit 0
fi

if [ "$1" = "config" ]; then
echo 'graph_title PHP5-FPM Processes'
echo 'graph_title PHP-FPM Processes'
echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel PHP5-FPM Processes'
echo 'graph_vlabel PHP-FPM Processes'
echo 'graph_category PHP'
echo 'graph_info This graph shows the number of PHP5-FPM processes in the system.'
echo 'php_processes.label PHP5-FPM Processes'
echo 'graph_info This graph shows the number of PHP-FPM processes in the system.'
echo 'php_processes.label PHP-FPM Processes'
echo 'php_processes.draw LINE2'
echo 'php_processes.info The current number of PHP5-FPM processes.'
echo 'php_processes.info The current number of PHP-FPM processes.'
exit 0
fi

Expand Down
47 changes: 42 additions & 5 deletions phpfpm_status
@@ -1,8 +1,45 @@
#!/usr/bin/perl
#
# Magic markers:
#%# family=auto
#%# capabilities=autoconf
# -*- perl -*-

=encoding utf8
=head1 NAME
phpfpm_status - Munin plugin to monitor the staus of PHP-FPM.
=head1 CONFIGURATION
For this plugin, you will need to enable the status feature
included in versions 5.3.2+ of PHP-FPM. The directive can be
found in the php5-fpm.conf file:
pm.status_path = /status
You might need to specify connection parameters in the plugin
configuration to override the defaults. These are the defaults:
[phpfpm_*]
env.url http://127.0.0.1/status
env.ports 80
=head1 PARAMETERS:
config (required)
autoconf (optional - used by munin-config)
=over
=head1 LICENSE
Copyright TJ Stein 2010 http://constantshift.com
=head1 MAGICK MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut


my $ret = undef;

Expand Down Expand Up @@ -41,7 +78,7 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" )

if ( defined $ARGV[0] and $ARGV[0] eq "config" )
{
print('graph_title PHP5-FPM Status
print('graph_title PHP-FPM Status
graph_args --base 1024 -l 0
graph_vlabel Connections
graph_category PHP
Expand Down

0 comments on commit ad0c851

Please sign in to comment.