diff --git a/Bundler/munin-server.xml b/Bundler/munin-server.xml index 62f334a..f366c03 100644 --- a/Bundler/munin-server.xml +++ b/Bundler/munin-server.xml @@ -3,4 +3,8 @@ + + + + diff --git a/Cfg/etc/init.d/munin-fastcgi/info.xml b/Cfg/etc/init.d/munin-fastcgi/info.xml new file mode 100644 index 0000000..a0b21f3 --- /dev/null +++ b/Cfg/etc/init.d/munin-fastcgi/info.xml @@ -0,0 +1,3 @@ + + + diff --git a/Cfg/etc/init.d/munin-fastcgi/munin-fastcgi b/Cfg/etc/init.d/munin-fastcgi/munin-fastcgi new file mode 100755 index 0000000..db88acc --- /dev/null +++ b/Cfg/etc/init.d/munin-fastcgi/munin-fastcgi @@ -0,0 +1,84 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: munin-fastcgi +# Required-Start: $remote_fs $network +# Required-Stop: $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: starts munin-fastcgi +# Description: Spawn Munin FCGI sockets for Web access +### END INIT INFO + +# +# munin-fastcgi Startup script for Munin CGI services +# +# chkconfig: - 84 15 +# description: Loading Munin CGI services using spawn-cgi +# HTML files and CGI. +# +# Author: Ryan Norbauer +# Modified: Geoffrey Grosenbach http://topfunky.com +# Modified: David Krmpotic http://davidhq.com +# Modified: Kun Xi http://kunxi.org +# Modified: http://drumcoder.co.uk/ +# Modified: http://uname.pingveno.net/ + +DAEMON=/usr/bin/spawn-fcgi +FCGI_GRAPH_SOCK=/var/run/munin/fastcgi-munin-graph.sock +FCGI_HTML_SOCK=/var/run/munin/fastcgi-munin-html.sock +WWW_USER=www-data +FCGI_USER=munin +FCGI_GROUP=munin +FCGI_SPAWN_GRAPH=/usr/lib/munin/cgi/munin-cgi-graph +FCGI_SPAWN_HTML=/usr/lib/munin/cgi/munin-cgi-html +PIDFILE_GRAPH=/var/run/munin/fastcgi-munin-graph.pid +PIDFILE_HTML=/var/run/munin/fastcgi-munin-html.pid +DESC="Munin FCGI for Graph and HTML" + +# Gracefully exit if the package has been removed. +test -x $DAEMON || exit 0 +test -x $FCGI_SPAWN_GRAPH || exit 0 +test -x $FCGI_SPAWN_HTML || exit 0 + +start() { + $DAEMON -s $FCGI_GRAPH_SOCK -U $WWW_USER -u $FCGI_USER -g $FCGI_GROUP -P $PIDFILE_GRAPH $FCGI_SPAWN_GRAPH 2> /dev/null || echo "Graph Already running" + $DAEMON -s $FCGI_HTML_SOCK -U $WWW_USER -u $FCGI_USER -g $FCGI_GROUP -P $PIDFILE_HTML $FCGI_SPAWN_HTML 2> /dev/null || echo "HTML Already running" +} + +stop() { + kill -QUIT `cat $PIDFILE_GRAPH` || echo "Graph not running" + kill -QUIT `cat $PIDFILE_HTML` || echo "HTML Not running" +} + +restart() { + kill -HUP `cat $PIDFILE_GRAPH` || echo "Can't reload Graph" + kill -HUP `cat $PIDFILE_HTML` || echo "Can't reload HTML" +} + +case "$1" in + start) + echo "Starting $DESC: " + start + ;; + stop) + echo "Stopping $DESC: " + stop + ;; + restart|reload) + echo "Restarting $DESC: " + stop + # One second might not be time enough for a daemon to stop, + # if this happens, d_start will fail (and dpkg will break if + # the package is being upgraded). Change the timeout if needed + # be, or change d_stop to have start-stop-daemon use --retry. + # Notice that using --retry slows down the shutdown process somewhat. + sleep 1 + start + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2 + exit 3 + ;; +esac + +exit $? diff --git a/Cfg/etc/nginx/sites-available/munin/info.xml b/Cfg/etc/nginx/sites-available/munin/info.xml new file mode 100644 index 0000000..28fd470 --- /dev/null +++ b/Cfg/etc/nginx/sites-available/munin/info.xml @@ -0,0 +1,3 @@ + + + diff --git a/Cfg/etc/nginx/sites-available/munin/munin b/Cfg/etc/nginx/sites-available/munin/munin new file mode 100644 index 0000000..9735664 --- /dev/null +++ b/Cfg/etc/nginx/sites-available/munin/munin @@ -0,0 +1,30 @@ +# Fichier géré par bcfg2 ! +server { + listen 80; + listen [::]:80 ipv6only=on; + server_name fy.adm.crans.org fy.crans.org munin.crans.org; + #access_log off; + root /var/www/munin/; + index index.html index.htm; + + location / { + fastcgi_pass unix:/var/run/munin/fastcgi-munin-html.sock; + include fastcgi_params; + } + + location /munin-graph { + fastcgi_split_path_info ^(/munin-graph)(.*); + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_pass unix:/var/run/munin/fastcgi-munin-graph.sock; + include fastcgi_params; + } + + location /static/ { + alias /etc/munin/static/; + } + + location /favicon.ico { + alias /etc/munin/static/$request_uri; + } + +} diff --git a/Metadata/groups.xml b/Metadata/groups.xml index d9c4a62..0df366c 100644 --- a/Metadata/groups.xml +++ b/Metadata/groups.xml @@ -1571,6 +1571,7 @@ + diff --git a/Python/etc/monit/services b/Python/etc/monit/services index 68de93e..c3a94a7 100644 --- a/Python/etc/monit/services +++ b/Python/etc/monit/services @@ -186,6 +186,14 @@ service("mysql", service("munin-node", pidf="munin/munin-node") +service("munin-server", + name="munin-fastcgi", + pidf="munin/fastcgi-munin-graph", + extra=[ + "if failed unixsocket /var/run/munin/fastcgi-munin-graph.sock then restart", + "if failed unixsocket /var/run/munin/fastcgi-munin-html.sock then restart", + ]) + service("nslcd", pidf="nslcd/nslcd", extra=["if failed unixsocket /var/run/nslcd/socket then restart"]) diff --git a/Python/etc/munin/munin.conf b/Python/etc/munin/munin.conf index b49036d..8513f7f 100755 --- a/Python/etc/munin/munin.conf +++ b/Python/etc/munin/munin.conf @@ -38,13 +38,13 @@ contact.roots.command mail -s "Munin - ${var:host} : ${var:graph_title}" nobody@ #contact.impression.command mail -s "Munin - ${var:graph_title}" impression@crans.org # Nagios -contact.nagios.command /usr/sbin/send_nsca -H localhost -c /etc/send_nsca.cfg -to 120 > /dev/null -contacts nagios +#contact.nagios.command /usr/sbin/send_nsca -H localhost -c /etc/send_nsca.cfg -to 120 > /dev/null +#contacts nagios # Les graphes sont réalisés via le CGI graph_strategy cgi cgiurl /munin-bin -cgiurl_graph /munin-cgi/munin-cgi-graph +cgiurl_graph /munin-graph # Et l'html aussi html_strategy cgi