Installing munin & configuring apache.

I tried to install munin & configure apache. But it just didn't work for me. You need to fine-tune apache.
If it works for someone i'm interested.
 
What exactly is the problem you're having? "It doesn't work for me" doesn't provide much to go on.
 
Do you absolutly need Apache? Munin uses rrd which is really ideal.
I used lightttpd for the web server.

I guess for the live charts you might need it and CGI.
 
If you look at the instructions from Munin.org they give a basic setup.
Have you tried to get a static Munin setup running.
That is where you should start.
Then worry about Apache, CGI and sparks and fireworks.
Basic Munin charts are very nice.
 
But this is the guide for linux.
Apache CGI Configuration — Munin 2.999.10-detached-2018-12-16-c13-g47debb5 documentation I must make little small changes to this file, but the correct ones.
Looks pretty straight-forward. Just look at the files it installs pkg info -l munin-master. If I just look at the pkg-plist it's pretty easy to 'translate' those Linux based directories to the ones the FreeBSD package/port installs.

Code:
/etc/munin/static -> /usr/local/etc/munin/static/
/usr/lib/munin/cgi/munin-cgi-graph -> /usr/local/www/cgi-bin/munin-cgi-graph
/usr/lib/munin/cgi/munin-cgi-html -> /usr/local/www/cgi-bin/munin-cgi-html
/usr/lib/munin/cgi -> /usr/local/www/cgi-bin
/var/www -> /usr/local/www/munin
 
I will post my basic setup if you want. Nothing fancy. Munin installs rrd.
pkg install munin-master munin-node munin-contrib
Code:
## /usr/local/etc/lighttpd/lighttpd.conf
##
var.log_root    = "/var/log/lighttpd"
var.server_root = "/usr/local/www/munin"
var.state_dir   = "/run"
var.home_dir    = "/var/run/lighttpd"
var.conf_dir    = "/usr/local/etc/lighttpd"

var.vhosts_dir  = server_root + "/vhosts"
var.cache_dir   = "/var/cache/lighttpd"
var.socket_dir  = home_dir + "/sockets"
include "modules.conf"
server.port = 80
server.username  = "www"
server.groupname = "www"
server.document-root = "/usr/local/www" + "/munin"
server.errorlog             = log_root + "/error.log"
include "conf.d/access_log.conf"
include "conf.d/debug.conf"
server.network-backend = "writev"
server.max-fds = 2048
server.stat-cache-engine = "simple"
server.max-connections = 1024
index-file.names += ("index.xhtml", "index.html", "index.htm", "default.htm", "index.php")
url.access-deny  = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
include "conf.d/mime.conf"
include "conf.d/dirlisting.conf"
# IPv4 listening socket
$SERVER["socket"] == "0.0.0.0:80" { }
 
/usr/local/etc/munin/munin.conf
Code:
includedir /usr/local/etc/munin/munin-conf.d
graph_strategy cron
html_strategy cron
# a simple host tree
[Munin-APU1]
    address 127.0.0.1
    use_node_name yes

[8470p]
    address 192.168.1.100
    use_node_name yes

[E6420]
    address 192.168.1.111
    use_node_name yes

[debian]
    address 192.168.1.123
    use_node_name yes
 
Host monitoring node. /usr/local/etc/munin/munin-node.conf
Code:
# Example config-file for munin-node
#
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel
# Regexps for files to ignore
ignore_file [\#~]$
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

allow ^127\.0\.0\.1$
allow ^::1$

# Which address to bind to;
host *
# host 127.0.0.1

# And which port
port 4949
 
Manually running,
/usr/local/www/cgi-bin/munin-cgi-html
bails out with :
2021/07/16 20:47:49 [FATAL] munin_readconfig_part(datafile) - missing file
Note, I compiled everything with
Code:
DEFAULT_VERSIONS+=perl=5.32
DEFAULT_VERSIONS+=perl5=5.32

Placing a file
Code:
#!/usr/local/bin/perl
print "Content-Type: text/html\n\n";
print ("<h1>Perl is working!</h1>");
in /usr/local/www/cgi-bin/ renders fine.
 
I will post my basic setup if you want. Nothing fancy. Munin installs rrd.
pkg install munin-master munin-node munin-contrib
Code:
## /usr/local/etc/lighttpd/lighttpd.conf
##
var.log_root    = "/var/log/lighttpd"
var.server_root = "/usr/local/www/munin"
var.state_dir   = "/run"
var.home_dir    = "/var/run/lighttpd"
var.conf_dir    = "/usr/local/etc/lighttpd"

var.vhosts_dir  = server_root + "/vhosts"
var.cache_dir   = "/var/cache/lighttpd"
var.socket_dir  = home_dir + "/sockets"
include "modules.conf"
server.port = 80
server.username  = "www"
server.groupname = "www"
server.document-root = "/usr/local/www" + "/munin"
server.errorlog             = log_root + "/error.log"
include "conf.d/access_log.conf"
include "conf.d/debug.conf"
server.network-backend = "writev"
server.max-fds = 2048
server.stat-cache-engine = "simple"
server.max-connections = 1024
index-file.names += ("index.xhtml", "index.html", "index.htm", "default.htm", "index.php")
url.access-deny  = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
include "conf.d/mime.conf"
include "conf.d/dirlisting.conf"
# IPv4 listening socket
$SERVER["socket"] == "0.0.0.0:80" { }
Thanks for the info , but it differs alot from this one,

 
If the maintainer of munin would include a configuration file specificlyf or lighttp,nginx,apache it would be easier.
I tried the sources from the github repo. But ended in a perl hell.
I trow the handdoek in the ring, it's time to test cacti which has more or less same functionality
 
Another option might be netdata depending on your needs, which works out of the box (you may need to change IP address in the netdata's config file)
 
And zabbix needs php < 80
net-mgmt/zabbix6-frontend builds with PHP 7.4 even if you set the default to some other PHP version. If you use packages make sure to install zabbix6-frontend-php74, so you get the PHP 7.4 'flavor'.

The Zabbix frontend doesn't support PHP 8.0 (or higher) just yet. It is being worked on though: https://support.zabbix.com/browse/ZBXNEXT-7080

Also watch out for net-mgmt/zabbix6-server, it depends on MySQL 8.0, regardless of what default mysql version you have set. The reason for this is that Zabbix 6 requires MySQL 8.0. Zabbix 6 does also support MariaDB 10.5/10.6 but because of the way the port has been altered it's now configured to always depend on MySQL 8.0. As far as I know the maintainer is aware of this and is trying to add MariaDB support back to the port.
 
Host monitoring node. /usr/local/etc/munin/munin-node.conf
Code:
# Example config-file for munin-node
#
log_level 4
log_file /var/log/munin/munin-node.log
pid_file /var/run/munin/munin-node.pid

background 1
setsid 1

user root
group wheel
# Regexps for files to ignore
ignore_file [\#~]$
ignore_file DEADJOE$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
ignore_file \.pod$
ignore_file \.sample$

allow ^127\.0\.0\.1$
allow ^::1$

# Which address to bind to;
host *
# host 127.0.0.1

# And which port
port 4949
Is this for munin version 2.0.69 ?
Munin is failing for me big time.
Maybe someone should edit "pkg info -D minun..." to ease the pain?
 
I am running quarterly packages on this machine.

munin-node-2.0.69
lighttpd-1.4.64_1
perl5-5.32.1_1
python38-3.8.13

Can you get the Munin webpage to show up?
Focus on munin-master and munin-node.
Use the configs files from above.

Follow this very important pkg message to activate plugins.
Code:
If this is a fresh install run
/usr/local/sbin/munin-node-configure --shell | sh -x
to install the plugins automatically.
Let this run until complete.

Now get your munin-node running: service start munin-node

Get your webserver up and running the Munin homepage.

Check your munin-node to make sure it is up.
telnet localhost 4949
list
config cpu
Check to make sure you have plugins working: munin-node-configure

Once you get this far you can work on extras with munin-contrib.
Then rescan your plugins.
Get your system plugins working first.

 
Phishry i tried but it did not worked.
/ : gives 403 forbidden
/munin : gives 404 not found
Code:
lighttpd-1.4.64_1              Secure, fast, compliant, and flexible Web Server
munin-common-2.0.69            Common components between a munin node and server
munin-contrib-g.2021.04.27     Contributed plugins and other for munin
munin-master-2.0.69            Collector part of Munin
munin-node-2.0.69              Node-specific part of Munin
 
I tried munin+nginx but failed big time:
Here i share how i started spawn-fcgi:
Code:
spawn-fcgi -s /var/run/munin/fastcgi-graph.sock -U 80 -u 842 -g 842 /usr/local/www/cgi-bin/munin-cgi-graph
spawn-fcgi -s /var/run/munin/fastcgi-html.sock  -U 80 -u 842 -g 842 /usr/local/www/cgi-bin/munin-cgi-html
This is my nginx.conf:
Code:
#MUNIN
    server {
        listen      127.0.0.1:33331;
        server_name 127.0.0.1:33331;
        root /usr/local/www/munin/;
        allow 127.0.0.1;
        deny all;
        autoindex on;

        location ^~ /usr/local/www/cgi-bin/ {
            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/etc/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;
    }
       
       
    }

If someone sees a mistake ?
I have the impression spawn-fcgi dies ?
 
I know from another thread that you want fast monitoring not cron. I get that.

But munin is not all that. It is a Linux based program so every plugin works on that.
For FreeBSD not so much.

So instead of wasting time on CGI look at what static does and lacks.
FreeBSD vs. Linus monitoring.
You will see you have alot of tuning to do. Our disk name is ada not sda. ect.ect.ect.
The basic plugins take a lot of tuning. Just wanted to let you know. This is good old school stuff.
Not unbearable but takes time.
Auto install plugins just gives a a overview of what works OOB. Give it a try.
You will probably run away laughing in insanity. But bear down and the plugins are great.
They just need a BSD touch. Here is something to save you some time.
My Chelsio's work from the basic plugins and the stats available are impressive.
Some area's the plugins shine others will never work on FreeBSD.
That is just the system plugins that ship with munin.
 
Back
Top