Munin Dynazoom not working on Ubuntu
Asked Answered
C

8

14

I recently installed Munin on my machines. I got everything to work and the data is actually being drawn on the graphs! :)

But, for some reason, when I click on each individual graph, it brings me to the dynazoom page but it's all plain text with no images :(

Here is my apache.conf:

# Enable this for template generation
Alias /munin /var/cache/munin/www

# Enable this for cgi-based templates
#Alias /munin-cgi/static /var/cache/munin/www/static
#ScriptAlias /munin-cgi /usr/lib/munin/cgi/munin-cgi-html
#<Location /munin-cgi>
#       Order allow,deny
#       Allow from localhost 127.0.0.0/8 ::1
#       AuthUserFile /etc/munin/munin-htpasswd
#       AuthName "Munin"
#       AuthType Basic
#       require valid-user
#</Location>

<Directory /var/cache/munin/www>
        Order allow,deny
        # Allow from localhost 127.0.0.0/8 ::1
        Allow from all
        Options None
        AllowOverride None

        # This file can be used as a .htaccess file, or a part of your apache
        # config file.
        #
        # For the .htaccess file option to work the munin www directory
        # (/var/cache/munin/www) must have "AllowOverride all" or something 
        # close to that set.
        #

        AuthUserFile /etc/munin/munin-htpasswd
        AuthName "Munin"
        AuthType Basic
        require valid-user

        # This next part requires mod_expires to be enabled.
        #

        # Set the default expiration time for files to 5 minutes 10 seconds from
        # their creation (modification) time.  There are probably new files by
        # that time. 
        #

    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault M310
    </IfModule>

</Directory>

# Enables fastcgi for munin-cgi-html if present
#<Location /munin-cgi>
#    <IfModule mod_fastcgi.c>
#        SetHandler fastcgi-script
#    </IfModule>
#</Location>

#<Location /munin-cgi/static>
#       SetHandler None
#</Location>

# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
        Order allow,deny
        Allow from localhost 127.0.0.0/8 ::1
        # AuthUserFile /etc/munin/munin-htpasswd
        # AuthName "Munin"
        # AuthType Basic
        # require valid-user
        <IfModule mod_fcgid.c>
            SetHandler fcgid-script
        </IfModule>
        <IfModule !mod_fcgid.c>
            SetHandler cgi-script
        </IfModule>
</Location>

ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
<Location /munin-cgi/munin-cgi-html>
        Order allow,deny
        Allow from localhost 127.0.0.0/8 ::1
        # AuthUserFile /etc/munin/munin-htpasswd
        # AuthName "Munin"
        # AuthType Basic
        # require valid-user
        <IfModule mod_fcgid.c>
            SetHandler fcgid-script
        </IfModule>
        <IfModule !mod_fcgid.c>
            SetHandler cgi-script
        </IfModule>
</Location>

Any reason why this could not be working? If I haven't given enough information, please let me know. Thank you

Cabanatuan answered 28/4, 2014 at 22:25 Comment(3)
I just have the same problems as you. Have used Munin 1.4x with Ubunto 12.4 and no change to Ubuntu 14.04 with Munin 2.0.19. All is ok, except for Dynazoom.Irksome
@Jotne, yeah it seems a lot of people whom use Munin on Ubuntu have this issue, hopefully someone can find a solution to this problem.Cabanatuan
I found this, but have not had time to test it, you can try to see if it helps: munin-monitoring.org/wiki/MuninConfigurationMasterCGIIrksome
M
13

I had the same issue on Ubuntu 14.04.

By checking /var/log/apache2/error.log I found the script complaining about missing modules:

Can't locate CGI/Fast.pm in @INC (you may need to install the CGI::Fast module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl) at /usr/lib/munin/cgi/munin-cgi-graph line 36.

I did install the CGI::Fast module to solve the issue:

sudo apt-get install libcgi-fast-perl

There is no need for any rewrite rule as indicated in another answer. Packages in Ubuntu 14.04 have the path names configured correctly.

Muscovite answered 13/7, 2014 at 7:54 Comment(2)
For me it worked after I did this but I also needed to change the munin.conf as outlined by @Kaiser belowMultipartite
In my case I have no error like this in /var/log/apache2/error.log and zooming is not working anyway.Swoop
E
12

Enabling the apache2 cgi (or cgid) makes the dynazoom work.

sudo a2enmod cgi; sudo service apache2 restart
Expire answered 16/7, 2014 at 14:46 Comment(2)
I was going crazy not getting it work on Debian 8. It was that simple. Thanks!Unplaced
same here, debian 8, just need to enable the cgi moduleHeavyladen
P
8

In addition to ermannob's answer; my apache2 error.log reported

  AH01797: client denied by server configuration: /usr/lib/munin/cgi/munin-cgi-graph

which stopped me from messing around with file permissions within the OS and caused me to look at the apache config. All that was required was to change

<Location /munin-cgi/munin-cgi-graph>
    Order allow,deny
    Allow from localhost 127.0.0.0/8 ::1
    ...

in /etc/apache2/conf-enabled/munin.conf, to

<Location /munin-cgi/munin-cgi-graph>
    Require all granted
    Options FollowSymLinks SymLinksIfOwnerMatch

I did not need to install any fastcgi packages and followed the tutorial here. They suggest that configuration be added to the apache.conf file directly, however, relaxing the permissions in the conf-enabled/munin.conf file (for /munin, /munin-cgi/munin-cgi-graph and /munin-cgi/munin-cgi-html) was sufficient. I omitted the changes to apache.conf.

Phyllotaxis answered 24/2, 2016 at 12:35 Comment(2)
Thanks dude! Followed the same guide and got some troubles with the zoomHufuf
Thank you! This is needed if using munin with the HTML caching in order for the chart zooming to work (since that one is dynamic). However this is not explained in the sample configuration on the munin website.Mordy
G
5

When running Ubuntu 14.04 I fixed this on my own servers by updating the apache config in /etc/apache2/conf-available/munin.conf from 2.2 style to 2.4

Example:

<Directory /var/cache/munin/www>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
....
</Directory>

needs to be changed to

<Directory /var/cache/munin/www>
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Require all granted
....
</Directory>

or you could do

Require host localhost

or

Require ip 127.0.0.0/8 ::8

see apache documentation about the changes here. By the time I realized this, I had already gone through and installed FastCGI and the perl module listed in this thread. This change would need to be done to all the location/directory areas you see in munin.conf.

Gumdrop answered 30/7, 2014 at 23:21 Comment(2)
This worked for me, but only after I also installed libcgi-fast-perl as described in a sister postingMultipartite
I also had to install libapache2-mod-fcgidTecumseh
E
4

I had the same problem on Debian 8. I've edited the file /etc/munin/apache24.conf like that:

Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www>
   Require all granted
   Options FollowSymLinks SymLinksIfOwnerMatch
</Directory>

ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
    Require all granted
    Options FollowSymLinks SymLinksIfOwnerMatch
        <IfModule mod_fcgid.c>
            SetHandler fcgid-script
        </IfModule>
        <IfModule !mod_fcgid.c>
            SetHandler cgi-script
        </IfModule>
</Location>

Then I installed the libapache2-mod-fcgid as mentioned earlier.

After a munin-node restart, it's working correctly.

Eckmann answered 19/5, 2015 at 9:58 Comment(0)
O
1

I had experienced the same behavior in Ubuntu 14.04 LTS. The reason was the image URL in the dynazoom page was incorrectly using /cgi-bin/munin-cgi-graph/ instead of /munin-cgi/munin-cgi/graph/ so instead of hunting down in the code to fix this bug I worked around it with a quick rewrite rule:

RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1

Hope this helps

Ovular answered 11/7, 2014 at 9:3 Comment(0)
Z
1

You should change the configuration part about the munin-cgi-graph, setting the same permissions as the main section. Here's your configuration:

# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
    Order allow,deny
    Allow from localhost 127.0.0.0/8 ::1
    # AuthUserFile /etc/munin/munin-htpasswd
    # AuthName "Munin"
    # AuthType Basic
    # require valid-user
    <IfModule mod_fcgid.c>
        SetHandler fcgid-script
    </IfModule>
    <IfModule !mod_fcgid.c>
        SetHandler cgi-script
    </IfModule>
</Location>

change it to this:

# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
    Order allow,deny
    # Allow from localhost 127.0.0.0/8 ::1
    Allow from all
    AuthUserFile /etc/munin/munin-htpasswd
    AuthName "Munin"
    AuthType Basic
    require valid-user
    <IfModule mod_fcgid.c>
        SetHandler fcgid-script
    </IfModule>
    <IfModule !mod_fcgid.c>
        SetHandler cgi-script
    </IfModule>
</Location>

Additionally I had to install the libcgi-fast-perl package, doing this:

sudo apt-get install libcgi-fast-perl

Checking /var/log/apache2/error.log helped me a lot.

Zumwalt answered 13/9, 2014 at 7:12 Comment(0)
S
0

In my case following https://bugs.launchpad.net/ubuntu/+source/munin/+bug/1258026 and http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI worked.

The only problematic part was where to put Apache virtual host configuration, it turned out that placing it at /etc/apache2/sites-enabled/001-munin.conf worked.

Swoop answered 20/4, 2016 at 13:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.