Project

General

Profile

Howto Munin Fastcgi

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

  1. Install CGI::Fast, on Debian/Ubuntu it's in libcgi-fast-perl.
  2. 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".
  3. Set "graph_strategy cgi" in munin.conf
  4. spawn the munin-fastcgi-graph FastCGI application (See recommended way to supervise it):
    /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
    
  5. setup your munin vhost for lighttpd2
    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";
    }
    

    You need some basics for this if you don't already have them:
    setup {
        module_load ( "mod_expire", "mod_fastcgi", "mod_lua" );
        lua.plugin "core.lua";
    }
    
  6. example munin.conf snippet
    htmldir /var/cache/munin/www
    graph_strategy cgi
    cgiurl_graph /cgi-bin/munin-cgi-graph
    

Updated by stbuehler over 6 years ago · 3 revisions