Monitoring de la connectivité à php-fpm et sogo
This commit is contained in:
parent
1473fd6f99
commit
f5134d6993
10 changed files with 46 additions and 17 deletions
|
@ -1,7 +1,7 @@
|
||||||
<Bundle name="nginx">
|
<Bundle name="nginx">
|
||||||
<Package name="nginx"/>
|
<Package name="nginx"/>
|
||||||
<Service name="nginx"/>
|
<Service name="nginx"/>
|
||||||
<Path name="/etc/nginx/sites-available/status"/>
|
<Python name="/etc/nginx/sites-available/status"/>
|
||||||
<Path name="/etc/nginx/sites-enabled/status"/>
|
<Path name="/etc/nginx/sites-enabled/status"/>
|
||||||
<!-- Conf gérée à la main pour chaque service -->
|
<!-- Conf gérée à la main pour chaque service -->
|
||||||
<Group name="munin-node">
|
<Group name="munin-node">
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<Bundle name="php">
|
<Bundle name="php">
|
||||||
<Group name="nginx">
|
<Group name="nginx">
|
||||||
<Package name="php5-fpm"/>
|
<Package name="php5-fpm"/>
|
||||||
|
<Action name="php5-fpm-restart"/>
|
||||||
<Path name="/etc/nginx/snippets/php.conf"/>
|
<Path name="/etc/nginx/snippets/php.conf"/>
|
||||||
|
<Path name="/etc/php5/fpm/pool.d/www.conf"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Bundle>
|
</Bundle>
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
<FileInfo>
|
|
||||||
<Info owner='root' group='root' perms='0644'/>
|
|
||||||
</FileInfo>
|
|
|
@ -1,10 +0,0 @@
|
||||||
server {
|
|
||||||
listen 127.0.0.1;
|
|
||||||
server_name localhost;
|
|
||||||
location /nginx_status {
|
|
||||||
stub_status on;
|
|
||||||
access_log off;
|
|
||||||
allow 127.0.0.1;
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,3 +14,13 @@ location ~ .+\.php {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location ~ ^/php_(ping|status)$ {
|
||||||
|
access_log off;
|
||||||
|
allow 127.0.0.1;
|
||||||
|
deny all;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
|
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<Client name="nem.adm.crans.org" profile="nem" pingable="Y"/>
|
<Client name="nem.adm.crans.org" profile="nem" pingable="Y"/>
|
||||||
<Client name="isc.adm.crans.org" profile="isc" pingable="Y"/>
|
<Client name="isc.adm.crans.org" profile="isc" pingable="Y"/>
|
||||||
<Client name="roundcube.adm.crans.org" profile="roundcube" pingable="Y"/>
|
<Client name="roundcube.adm.crans.org" profile="roundcube" pingable="Y"/>
|
||||||
<Client name="horde.adm.crans.org" profile="roundcube" pingable="Y"/>
|
<Client name="horde.adm.crans.org" profile="horde" pingable="Y"/>
|
||||||
<Client name="schrodingred.adm.crans.org" profile="schrodingred" pingable="Y"/>
|
<Client name="schrodingred.adm.crans.org" profile="schrodingred" pingable="Y"/>
|
||||||
|
|
||||||
<!-- La ferme -->
|
<!-- La ferme -->
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
<Group name="horde"
|
<Group name="horde"
|
||||||
profile="true">
|
profile="true">
|
||||||
<Group name="crans-vm-wheezy"/>
|
<Group name="crans-vm-wheezy"/>
|
||||||
|
<Group name="horde-groupware" />
|
||||||
<Group name="nginx" comment="Pour horde" />
|
<Group name="nginx" comment="Pour horde" />
|
||||||
<Group name="php" comment="Pour horde" />
|
<Group name="php" comment="Pour horde" />
|
||||||
<Group name="https_cert"/>
|
<Group name="https_cert"/>
|
||||||
|
|
|
@ -52,14 +52,14 @@ service("apache",
|
||||||
|
|
||||||
service('nginx')
|
service('nginx')
|
||||||
|
|
||||||
service('sogo', pidf="sogo/sogo")
|
service('sogo', pidf="sogo/sogo", extra=['if failed host localhost port 20000 protocol http timeout 20 seconds for 5 cycles then restart'])
|
||||||
|
|
||||||
service('ejabberd',
|
service('ejabberd',
|
||||||
pidf='ejabberd/ejabberd')
|
pidf='ejabberd/ejabberd')
|
||||||
|
|
||||||
if has('nginx'):
|
if has('nginx'):
|
||||||
if has('php'):
|
if has('php'):
|
||||||
service(name='php5-fpm')
|
service(name='php5-fpm', extra=["if failed host localhost port 80 protocol http and request '/php_ping' timeout 20 seconds for 5 cycles then restart"])
|
||||||
if has('cgi'):
|
if has('cgi'):
|
||||||
service(name='fcgiwrap', pidp='/var/run/fcgiwrap.pids')
|
service(name='fcgiwrap', pidp='/var/run/fcgiwrap.pids')
|
||||||
|
|
||||||
|
|
20
Python/etc/nginx/sites-available/status
Normal file
20
Python/etc/nginx/sites-available/status
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- mode: python; encoding: utf-8 -*-
|
||||||
|
|
||||||
|
info["owner"] = "root"
|
||||||
|
info["group"] = "root"
|
||||||
|
info["perms"] = 0644
|
||||||
|
|
||||||
|
comment_start = "#"
|
||||||
|
|
||||||
|
print """server {
|
||||||
|
listen 127.0.0.1;
|
||||||
|
server_name localhost;
|
||||||
|
location /nginx_status {
|
||||||
|
stub_status on;
|
||||||
|
access_log off;
|
||||||
|
allow 127.0.0.1;
|
||||||
|
deny all;
|
||||||
|
}"""
|
||||||
|
if has("php"):
|
||||||
|
print ' include "snippets/php.conf";'
|
||||||
|
print "}"
|
9
Rules/php.xml
Normal file
9
Rules/php.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<Rules priority="1">
|
||||||
|
<Group name="php">
|
||||||
|
<Group name="nginx">
|
||||||
|
<Action name="php5-fpm-restart" timing="post"
|
||||||
|
when="modified" status="check"
|
||||||
|
command="/etc/init.d/php5-fpm restart"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Rules>
|
Loading…
Add table
Add a link
Reference in a new issue