Projet

Général

Profil

Révision 4528900a

ID4528900a44c20b2210374482a66a20066912ae4a
Parent 9bc507b3
Enfant ab9c97ca, 61ce6727

Ajouté par Calle Kabo il y a plus de 12 ans

Updated name and added env.pool

- The name in =head1 did not match the filename.
- The $pool-variable was used in the config-section, but was never initialized. It is now extracted from the fcgi-response

Voir les différences:

plugins/php/php_fpm_process
3 3

  
4 4
=head1 NAME
5 5

  
6
php_fpm_processes - Munin plugin to show number of number of use processes on php-fpm.
6
php_fpm_process - Munin plugin to show number of number of use processes on php-fpm.
7 7

  
8 8

  
9 9
Inspirated by php5-fpm_status plugin by Daniel Caillibaud
......
77 77
	        ''
78 78
	);
79 79

  
80

  
81
if ( defined $ARGV[0] and $ARGV[0] eq "config" )
82
{
83

  
84
  print "graph_title php5-fpm status $pool";
85
  print "graph_args --base 1000 -l 0";
86
  print "graph_vlabel Processes";
87
  print "graph_scale yes";
88
  print "graph_category php";
89
  print "graph_info This graph shows the php5-fpm process manager status from pool: $pool";
90
  print "active.label Active processes";
91
  print "active.type GAUGE";
92
  print "active.draw AREA";
93
  print "active.info The number of active processes";
94
  print "idle.label Idle processes";
95
  print "idle.type GAUGE";
96
  print "idle.draw STACK";
97
  print "idle.info The number of idle processes";
98
  print "total.label Total processes";
99
  print "total.type GAUGE";
100
  print "total.draw LINE2";
101
  print "total.info The number of idle + active processes";
102
  exit 0
103
}
104

  
105 80
$stdout =~ s/\r//g;
106 81

  
107 82
while($stdout =~ /([^\n]*)\n?/g) {
......
114 89
	} else {
115 90
		$body .= $1."\n";
116 91
	}
92
}
93

  
94
if ( defined $ARGV[0] and $ARGV[0] eq "config" )
95
{
96
 
97
  if($body =~ m/pool:\s+(.*?)\n/) {
98
    $pool = $1;
99
  }
100

  
101
  print "graph_title php5-fpm status $pool\n";
102
  print "graph_args --base 1000 -l 0\n";
103
  print "graph_vlabel Processes\n";
104
  print "graph_scale yes\n";
105
  print "graph_category php\n";
106
  print "graph_info This graph shows the php5-fpm process manager status from pool: $pool\n";
107
  print "active.label Active processes\n";
108
  print "active.type GAUGE\n";
109
  print "active.draw AREA\n";
110
  print "active.info The number of active processes\n";
111
  print "idle.label Idle processes\n";
112
  print "idle.type GAUGE\n";
113
  print "idle.draw STACK\n";
114
  print "idle.info The number of idle processes\n";
115
  print "total.label Total processes\n";
116
  print "total.type GAUGE\n";
117
  print "total.draw LINE2\n";
118
  print "total.info The number of idle + active processes\n";
119
  exit 0
117 120
}	
118 121

  
119 122
if($body =~ m/idle processes: (.*?)\n/) {

Formats disponibles : Unified diff