Setup alternative Twitter Bootstrap based Munin template

The Munin's generated web pages are very old fashioned and dull. Its design uses tables with small text and too much spaces. This guide will show how to change the Munin's template and should be continuation of Setup Munin on CentOS 7 with nginx. There will be two alternative Munin 2.x templates will be shown here:

1. Munin Dynamic Template

This alternative template uses jQuery and Twitter Bootstrap for Munin 1.x and 2.x versions that enhanced user experience and improve web pages' appearance. The following are the steps to setup this template:

  1. Download the template:

          
    cd /opt/
    git clone https://github.com/DaveMDS/munin_dynamic_template.git
          
        
  2. Open your custom Munin configuration file:

          
    vi /etc/munin/conf.d/00-munincustom.conf
          
        

    ... and append the script below:

          
    tmpldir /opt/munin_dynamic_template/munin2
    staticdir /opt/munin_dynamic_template/munin2/static
          
        
  3. Restart the spawn-fcgi-munin-html CGI:

          
    service spawn-fcgi-munin-html restart
          
        
  4. Open the nginx configuration for munin.yoursite.com:

          
    vi /etc/nginx/sites-available/munin.yoursite.com.conf
          
        

    ... and replace the content with the following script:

          
    server {
      listen XXX.XXX.XXX.XXX:80; # IPv4
      listen [XXXX:XXXX::XXXX:XXXX:XXXX:XXXX]:80 ipv6only=on; # IPv6
      server_name munin.yoursite.com;
    
      location / {
        fastcgi_split_path_info ^(/)(.*);
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
        access_log off;
        error_log /var/log/munin/munin-nginx-html-error.log error;
        fastcgi_pass unix:/var/run/munin/fcgi-munin-html.sock;
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/.htpasswd-users;
    
        # Serve static files
        location /static/ {
          alias /opt/munin_dynamic_template/munin2/static/;
        }
    
        # Munin CGI graph
        location ^~ /munin-cgi/munin-cgi-graph/ {
          access_log off;
          fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*);
          fastcgi_param PATH_INFO $fastcgi_path_info;
          fastcgi_pass unix:/var/run/munin/fcgi-munin-graph.sock;
          include fastcgi_params;
        }
      }
    }
          
        

    Note: Change the XXX.XXX.XXX.XXX and XXXX:XXXX::XXXX:XXXX:XXXX:XXX with your server's IPv4 and IPv6 addresses respectively.

  5. Restart nginx:

          
    systemctl restart nginx
          
        
  6. Check your Munin web interface and should look something like this:

    Munin Dynamic Template

2. Munstrap

Another alternative Munin 2.x templates also based on Twitter Bootstrap 3. The following steps will show how to setup this template:

  1. Download the template:

          
    cd /opt/
    git clone https://github.com/jonnymccullagh/munstrap.git
          
        
  2. Open your custom Munin configuration file:

          
    vi /etc/munin/conf.d/00-munincustom.conf
          
        

    ... and append the script below:

          
    tmpldir /opt/munstrap/templates
    staticdir /opt/munstrap/static
          
        
  3. Restart the spawn-fcgi-munin-html CGI:

          
    service spawn-fcgi-munin-html restart
          
        
  4. Open the nginx configuration for munin.yoursite.com:

          
    vi /etc/nginx/sites-available/munin.yoursite.com.conf
          
        

    ... and replace the content with the following script:

          
    server {
      listen XXX.XXX.XXX.XXX:80; # IPv4
      listen [XXXX:XXXX::XXXX:XXXX:XXXX:XXXX]:80 ipv6only=on; # IPv6
      server_name munin.yoursite.com;
    
      location / {
        fastcgi_split_path_info ^(/)(.*);
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
        access_log off;
        error_log /var/log/munin/munin-nginx-html-error.log error;
        fastcgi_pass unix:/var/run/munin/fcgi-munin-html.sock;
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/.htpasswd-users;
    
        # Serve static files
        location /static/ {
          alias /opt/munstrap/static/;
        }
    
        # Munin CGI graph
        location ^~ /munin-cgi/munin-cgi-graph/ {
          access_log off;
          fastcgi_split_path_info ^(/munin-cgi/munin-cgi-graph)(.*);
          fastcgi_param PATH_INFO $fastcgi_path_info;
          fastcgi_pass unix:/var/run/munin/fcgi-munin-graph.sock;
          include fastcgi_params;
        }
      }
    }
          
        

    Note: Change the XXX.XXX.XXX.XXX and XXXX:XXXX::XXXX:XXXX:XXXX:XXX with your server's IPv4 and IPv6 addresses respectively.

  5. Restart nginx:

          
    systemctl restart nginx
          
        
  6. Check your Munin web interface which should look something like this:

    Munstrap template

Comments

Hi
Do you think it would work on a apache server?
Ive had some work with fast-cgi on munin-2-beta and that didnt work so I'm not shure that I can modify it myself..
But I think I will have a go.

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.