Munin issue

Hi fellows,

I set up Munin according to this how to http://munin-monitoring.org/wiki/CgiHowto2. It partially works. The main site loads proper as well as I can click two levels into the graphs - but unfortunately I can't get the dynamic zoom feature working.

Code:
cat httpd-error.log
[Mon Mar 04 21:14:04 2013] [error] [client 10.0.10.10] File does not exist: /usr/local/www/Munin.MyDomain.Local/sites/MyDomain.Local, referer: http://munin.MyDomain.Local/MyDomain.Local/Storage-10.MyDomain.Local/static/dynazoom.html?MyDomain.Local=/cgi-bin/munin-cgi-graph&plugin_name=MyDomain.Local/Storage-10.MyDomain.Local/iostat&size_x=800&size_y=400&start_epoch=1362319810&stop_epoch=1362427810
It seems like it's looking for this:
cgitmpdir /usr/local/www/Munin.MyDomain.Local/tmp/munin
Code:
ls -lach /usr/local/www/Munin.MyDomain.Local/tmp/munin/munin-cgi-graph/
total 12
drwxr-xr-x  3 admin  admin   512B  4 Mär 02:37 .
drwxrwxrwx  3 admin  admin   512B  4 Mär 02:38 ..
drwxr-xr-x  3 admin  admin   512B  4 Mär 02:37 MyDomain.Local

But it's not redirecting into it ;/

Changes I made in the munin.conf:
Code:
htmldir /usr/local/www/Munin.MyDomain.Local/sites/Munin
html_strategy cgi
graph_strategy cgi
cgitmpdir /usr/local/www/MyDomain.Local/tmp/munin
cgiurl_graph /cgi-bin/munin-cgi-graph
logdir /usr/local/www/MyDomain.Local/logs/munin
log_file /usr/local/www/MyDomain.Local/logs/munin/munin-node.log

I modified the following lines of the given httpd-vhosts.conf:
Code:
<VirtualHost *:80>
[...]
Alias /cgi-bin/munin-cgi-html/static /usr/local/www/MyDomain.Local/sites/Munin/static
RedirectMatch ^/$ /cgi-bin/munin-cgi-html/
[...]
RewriteRule ^/favicon.ico /usr/local/www/MyDomain.Local/sites/Munin/static/favicon.ico [L]
RewriteRule ^/static/(.*) /usr/local/www/MyDomain.Local/sites/Munin/static/$1          [L]
[...]
RewriteRule ^(/.*\.html)?$           /cgi-bin/munin-cgi-html/$1 [PT]
[...]
RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1
[...]
RewriteRule ^/(.*.png)$  /cgi-bin/munin-cgi-graph/$1 [L,PT]
[...]
ScriptAlias /cgi-bin/munin-cgi-graph "/usr/local/www/MyDomain.Local/cgi-bin/munin-cgi-graph"
<Location /cgi-bin/munin-cgi-graph>
[...]
ScriptAlias /cgi-bin/munin-cgi-html "/usr/local/www/MyDomain.Local/cgi-bin/munin-cgi-html"
<Location /cgi-bin/munin-cgi-html>
[...]
<Location /cgi-bin/munin-cgi-html/static>
[...]
</VirtualHost>

I'm totally lost - can't find my blunder ;/ Any ideas?
 
Leander said:
Code:
cgitmpdir /usr/local/www/MyDomain.Localtmp/munin
Looks like it's missing a slash here.

Code:
cgitmpdir /usr/local/www/MyDomain.Local[B]/[/B]tmp/munin
 
SirDice said:
Looks like it's missing a slash here.
Code:
cgitmpdir /usr/local/www/MyDomain.Local[B]/[/B]tmp/munin

Thanks for the hint. This must have accidently happened when I prepared this post - I fixed it in the initial post - sorry about that.
Any other idea?

Best Regards
L
 
To me it seems like it is a pure redirection issue in vHost config. Apache logs the following error:
Code:
File does not exist: /usr/local/www/Munin.MyDomain.Local/sites/MyDomain.Local, referer: http://munin.MyDomain.Local/MyDomain.Local/

The files it is looking for are actually lieing in here:
/usr/local/www/Munin.MyDomain.Local/tmp/munin/munin-cgi-graph/MyDomain.Local



And this is the relevant vHost configuration part:
Code:
<IfModule mod_rewrite.c>
    # Rewrite rules to serve traffic from the root instead of /cgi-bin
    RewriteEngine On

    # Static files
    RewriteRule ^/favicon.ico /usr/local/www/Munin.MyDomain.Local/sites/Munin/static/favicon.ico [L]
    RewriteRule ^/static/(.*) /usr/local/www/Munin.MyDomain.Local/sites/Munin/static/$1          [L]

    # HTML
    RewriteRule ^(/.*\.html)?$           /cgi-bin/munin-cgi-html/$1 [PT]

    # Images
    RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1
    RewriteCond %{REQUEST_URI}                 !^/static
    RewriteRule ^/(.*.png)$  /cgi-bin/munin-cgi-graph/$1 [L,PT]
</IfModule>

# Ensure we can run (fast)cgi scripts
ScriptAlias /cgi-bin/munin-cgi-graph /usr/local/www/Munin.MyDomain.Local/cgi-bin/munin-cgi-graph
ScriptAlias /cgi-bin/munin-cgi-html /usr/local/www/Munin.MyDomain.Local/cgi-bin/munin-cgi-html

<Location ~ "/cgi-bin/(munin-cgi-graph|munin-cgi-html)">
    Options +ExecCGI
    <IfModule mod_fcgid.c>
        SetHandler fcgid-script
    </IfModule>
    <IfModule mod_fastcgi.c>
        SetHandler fastcgi-script
    </IfModule>
    <IfModule !mod_fastcgi.c>
        <IfModule !mod_fcgid.c>
            SetHandler cgi-script
        </IfModule>
    </IfModule>
    Allow from all
</Location>

<IfModule !mod_rewrite.c>
    <Location /cgi-bin/munin-cgi-html/static>
            # this needs to be at the end to override the above sethandler directives
            Options -ExecCGI
            SetHandler None
    </Location>
</IfModule>


I'm still stuck in here ;(
I could use some hints ;)

Thanks
 
I'm having exactly the same problem in Ubuntu, can't find any other report of it except for here. Did you get this resolved?
 
Hi there

I found the solution. The issue only occurs in combination with fastCGI. Using regular CGI instead results in a perfectly working Munin web interface. For myself, I reduced the suggested vHost configuration of Munin CgiHowto2 to the following (Apache 2.4 compatible):

Most important in order to let graphing work proper is the line:
Code:
SetHandler      cgi-script
Make sure there is no
Code:
SetHandler fastcgi-script
or
Code:
SetHandler fcgid-script
in the part of the Apache configuration which is responsible for serving Munin.

Code:
<IfModule mod_rewrite.c>
    # Rewrite rules to serve traffic from the root instead of /cgi-bin
    RewriteEngine On

    # Static files
    RewriteRule ^/favicon.ico /usr/local/www/Munin.FreeBSD.Local/sites/Munin/static/favicon.ico [L]
    RewriteRule ^/static/(.*) /usr/local/www/Munin.FreeBSD.Local/sites/Munin/static/$1          [L]

    # Default to HTML
    RewriteRule ^(/.*\.html)?$           /cgi-bin/munin-cgi-html/$1 [PT]

    # Images
    RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1
    RewriteCond %{REQUEST_URI}                 !^/static
    RewriteRule ^/(.*.png)$  /cgi-bin/munin-cgi-graph/$1 [L,PT]
</IfModule>

# Ensure we can run CGI scripts
<Location ~ "/cgi-bin/(munin-cgi-graph|munin-cgi-html)">
    Options         +ExecCGI
    SetHandler      cgi-script
    AllowOverride   None
    Require         all granted
</Location>

Nevertheless, I still need this stupid cronjob to run periodically in order to create a proper static HTML environment. Otherwise the Munin CGI script fails and displays HTTP ERROR 500. I originally was hoping to get rid of this cronjob by using a CGI strategy.

Anyway - let me know wheter you had luck and where able to solve your issue the same way.
Best regards
 
Not sure whether this helps these are my settings using nginx.

I removed the crontab entry after FastCGI configuration.

nginx virtual server:
Code:
       server {
                listen 80;
                server_name  status.escix.com;
                client_max_body_size 2M;
                root /usr/local/www;
location / {
        rewrite ^/$ munin/ redirect; break;
}

location ^~ /munin-cgi/munin-cgi-graph/ {
    fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*);
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass unix:/var/run/munin/fastcgi-graph.sock;
    include fastcgi_params;
}

location /munin/static/ {
    alias /usr/local/www/munin/static/;
}

location /munin/ {
    fastcgi_split_path_info ^(/munin)(.*);
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_pass unix:/var/run/munin/fastcgi-html.sock;
    include fastcgi_params;
}

               }

munin.conf
Code:
# Graphics files are generated either via cron or by a CGI process.
# See http://munin-monitoring.org/wiki/CgiHowto2 for more
# documentation.
# Since 2.0, munin-graph has been rewritten to use the cgi code.
# It is single threaded *by design* now.
#
graph_strategy cgi

# munin-cgi-graph is invoked by the web server up to very many times at the
# same time.  This is not optimal since it results in high CPU and memory
# consumption to the degree that the system can thrash.  Again the default is
# 6.  Most likely the optimal number for max_cgi_graph_jobs is the same as
# max_graph_jobs.
#
munin_cgi_graph_jobs 6
 
Back
Top