Showing posts with label Munin. Show all posts
Showing posts with label Munin. Show all posts

Monday, November 23, 2020

How to Install and Configure Munin Monitoring with Nginx and CGI on CentOS 8

Setting up Munin on CentOS 8 via EPEL 8 provides turnkey server performance graphs. This guide walks through configuring systemd timer units, fastcgi spawners for dynamic graph generation, and integrating the dashboard into an Nginx virtual host.

Packages: munin • munin-node • munin-cgi • spawn-fcgi

1. Installing Packages from EPEL 8

dnf install epel-release -y
dnf install munin munin-cgi munin-node spawn-fcgi nginx -y

2. Enabling Node and Systemd Services

systemctl enable --now munin-node
systemctl enable --now munin-cgi-graph.socket
systemctl enable --now munin-cgi-html.socket

3. Nginx Server Block (/etc/nginx/conf.d/munin.conf)

server {
    listen 80;
    server_name munin.example.com;

    location / {
        root /var/www/html/munin;
        index index.html;
    }

    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:/run/munin/fcgi-graph.sock;
        include fastcgi_params;
    }
}

Tuesday, July 31, 2012

How to Install and Configure Munin 2.0 with Nginx and FastCGI on CentOS 6

Munin 2.0 introduced dynamic CGI graph and HTML generation, allowing monitoring dashboards to scale efficiently without requiring static graph regeneration during every 5-minute cron cycle. Here is how to compile Munin 2.0 from source and integrate it with Nginx using spawn-fcgi on CentOS 6.

Stack: Munin 2.0.x • Nginx • FastCGI (spawn-fcgi) • CentOS 6 / RHEL 6

1. Installing Build Dependencies

Install Perl module prerequisites and development tools:

yum groupinstall 'Development Tools' -y
yum install perl-CGI perl-FCGI perl-File-Copy-Recursive perl-Module-Build perl-Cache-Cache git spawn-fcgi -y
groupadd munin
useradd munin -g munin -s /sbin/nologin -d /var/www/html/munin

2. Compiling Munin 2.0 from Source

cd /usr/src
git clone git://github.com/munin-monitoring/munin.git
cd munin
git checkout tags/2.0.0
make
make install

3. Spawning FastCGI Processes for Graph and HTML Generation

Munin 2.0 relies on two FastCGI workers: one for HTML page rendering and one for real-time RRD graph generation.

spawn-fcgi -s /var/run/munin/fcgi-graph.sock -u munin -g munin -- /var/www/html/munin/cgi/munin-cgi-graph
spawn-fcgi -s /var/run/munin/fcgi-html.sock -u munin -g munin -- /var/www/html/munin/cgi/munin-cgi-html

4. Nginx Server Configuration

Configure Nginx to proxy requests to the Munin FastCGI sockets:

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

location /munin/static/ {
    alias /etc/munin/static/;
}

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

5. Testing

Execute the Munin cron job under the munin system user to build the initial state:

sudo -u munin munin-cron

How Google Antigravity Solved the Mysterious NVIDIA Sleep Reboot on My Dell Inspiron 7567 (Ubuntu Linux)

If you run modern Ubuntu or Linux on a Dell Inspiron 15 Gaming (7567) or a similar 7th-gen Intel laptop paired with an NVIDIA GeForce GTX ...