Project

General

Profile

Howto Munin Fastcgi » History » Revision 2

Revision 1 (stbuehler, 2011-04-14 11:39) → Revision 2/3 (stbuehler, 2011-10-10 14:14)

h1. Howto Munin Fastcgi 

 External Docs: http://munin-monitoring.org/wiki/CgiHowto 

 # Install CGI::Fast, on Debian/Ubuntu it's in libcgi-fast-perl. 
 # You don't have to set/change cgiurl_graph, just use the same value in the lighttpd config (the munin fastcgi script doesn't care). The default value is "/cgi-bin/munin-cgi-graph". 
 # Set "graph_strategy cgi" in munin.conf 
 # spawn the munin-fastcgi-graph FastCGI application (See [[spawn-fcgi:Basic_Ideas|recommended way to supervise it]]): 
 <pre> 
 /usr/bin/spawn-fcgi -n -s /var/run/lighttpd2/munin-fastcgi-graph.sock -u munin -U www-data -- /usr/lib/cgi-bin/munin-fastcgi-graph 
 </pre> 
 # setup your munin vhost for lighttpd2 
 <pre> 
 if req.path =^ "/cgi-bin/" { 
	 core.wsgi ( "/cgi-bin/munin-cgi-graph", { ${ fastcgi "unix:/var/run/lighttpd2/munin-fastcgi-graph.sock"; } ); 
 } else { 
	 docroot "/var/cache/munin/www"; # or whatever your htmldir is 
	 index ( "index.html" ); 
	 expire "modification 5 minutes"; 
 } 
 </pre> 
   You need some basics for this if you don't already have them: 
 <pre> 
 setup { 
	 module_load ( "mod_expire", "mod_fastcgi", "mod_lua" ); 
	 lua.plugin "core.lua"; 
 } 
 </pre> 
 # example munin.conf snippet 
 <pre> 
 htmldir /var/cache/munin/www 
 graph_strategy cgi 
 cgiurl_graph /cgi-bin/munin-cgi-graph 
 </pre>