2018-11-24 17:08:00
@penfold to answer your question, yes you can boot off ZFS, I believe.
Clueless
2018-11-24 17:25:48
it can be the root volume pointed at from grub2
Rotonen
2018-11-24 17:26:01
you cannot peacefully cohabit a bootloader on the devices used for zfs
Rotonen
2018-11-24 17:28:29
I remember a lot discussion back in the day about freebsd booting from zfs
Fireduck
2018-11-24 17:28:39
And long guides about doing it
Fireduck
2018-11-24 17:28:47
Seemed not worth the effort
Fireduck
2018-11-24 17:36:12
a non-issue these days so long as you have somewhere grub can be loaded off of
Rotonen
2018-11-24 17:36:39
usb stick on motherboard internal header is a popular choice for home servers
Rotonen
2018-11-24 17:37:46
I love the idea of booting from ZFS for like a classroom or work environment
Clueless
2018-11-24 17:37:59
snapshot everyone's workstations daily kinda thing
Clueless
2018-11-24 17:38:19
but that's more a network boot thing
Clueless
2018-11-24 17:38:32
I usually stick 32gb USB nub in usb socket
Fireduck
2018-11-24 17:38:50
it's really only useful for when you have dozens of workstations to manage
Clueless
2018-11-24 17:39:08
I think
Clueless
2018-11-24 17:43:06
eh, it depends
Clueless
2018-11-24 17:43:28
ZFS nets me like 500MB, which is neat
Clueless
2018-11-24 18:48:52
@fydel so let's turn this into a 'how to munin' general for now
Rotonen
2018-11-24 18:49:16
so first stage stuff first - is rrdcached a thing on your munin master?
Rotonen
2018-11-24 18:49:31
read the docs level stuff
http://guide.munin-monitoring.org/en/latest/master/rrdcached.html
Rotonen
2018-11-24 18:49:36
yes sure.
fydel
2018-11-24 18:49:40
let me check.
fydel
2018-11-24 18:50:27
and, as that says, you need to run it as the munin (or www-data) user, as that's in the loop for producing the output, and such security is good enough for most things
Rotonen
2018-11-24 18:50:41
if you need something better, i'll have to get back to you sober and we'll first draft a contract
Rotonen
2018-11-24 18:51:20
but, here is an example systemd file for running one of those as the munin user on debian
```
$ cat /etc/systemd/system/munin-rrdcached.service
[Unit]
Description=Munin rrdcached
[Service]
Restart=always
User=munin
PermissionsStartOnly=yes
ExecStartPre=/usr/bin/install -d -o munin -g munin -m 0755 \
/var/lib/munin/rrdcached-journal /run/munin
ExecStart=/usr/bin/rrdcached \
-g -B -b /var/lib/munin/ \
-p /run/munin/munin-rrdcached.pid \
-F -j /var/lib/munin/rrdcached-journal/ \
-m 0660 -l unix:/run/munin/rrdcached.sock \
-w 1800 -z 1800 -f 3600
ExecStartPost=/bin/sleep 1 ; /bin/setfacl -m u:www-data:rw /run/munin/rrdcached.sock
[Install]
WantedBy=multi-user.target
```
Rotonen
2018-11-24 18:52:42
and then you just munin master config use that socket as the rrdcached socket
Rotonen
2018-11-24 18:53:08
i'll dig other stuff up in the meanwhile so once you've had your munin master update on that one two or more times in a row, ping me back
Rotonen
2018-11-24 18:53:59
okay. give me a couple of minutes.
fydel
2018-11-24 19:04:04
does the journal directory exist and does that user have write permissions to it?
Rotonen
2018-11-24 19:13:20
seems to work. i am just having trouble with the systemd stuff. maybe we check on that later.
fydel
2018-11-24 19:13:31
root@SB35 /var/lib/munin/rrdcached-journal # sudo -u munin /usr/bin/rrdcached -p /run/munin/rrdcached.pid -B -b /var/lib/munin/ -F -j /var/lib/munin/rrdcached-journal/ -m 0660 -l unix:/run/munin/rrdcached.sock -w 1800 -z 1800 -f 3600 -g
fydel
2018-11-24 19:13:39
no erros in /var/log/munin/munin-update.log
fydel
2018-11-24 19:13:48
no errors on console.
fydel
2018-11-24 19:14:27
so, how do you serve those html files munin generates?
Rotonen
2018-11-24 19:14:50
default via cron.
fydel
2018-11-24 19:14:54
no, http-wise
Rotonen
2018-11-24 19:16:09
no. i don't think so.
fydel
2018-11-24 19:16:14
it is generated all five minutes.
fydel
2018-11-24 19:16:24
how exactly does a webrowser reach your munin?
Rotonen
2018-11-24 19:16:35
the cronjob generates both html and the png
Rotonen
2018-11-24 19:16:48
now, to get to the next step, we'll need to make the html generation not static
Rotonen
2018-11-24 19:17:04
symlink. /var/www/html/munin -> /var/cache/munin/www
fydel
2018-11-24 19:17:14
munin provides an oldschool cgi script for exactly that
Rotonen
2018-11-24 19:17:28
do you have a `/usr/lib/munin/cgi/munin-cgi-html` ?
Rotonen
2018-11-24 19:17:51
root@SB35 /var/www/html # ls /usr/lib/munin/cgi/munin-cgi-html
/usr/lib/munin/cgi/munin-cgi-html
fydel
2018-11-24 19:17:52
yes
fydel
2018-11-24 19:18:05
how do you prefer to serve cgi scripts these days?
Rotonen
2018-11-24 19:18:27
cgi scripts are a web thing from before php was a thing
Rotonen
2018-11-24 19:18:28
i dont know. :cry:
fydel
2018-11-24 19:18:30
but not too unsimilar
Rotonen
2018-11-24 19:18:31
kk
Rotonen
2018-11-24 19:18:43
so install `spawn-fcgi`, that's useful for us here
Rotonen
2018-11-24 19:18:50
oki
fydel
2018-11-24 19:19:08
done
fydel
2018-11-24 19:19:41
and i also have a systemd bit for using that, which can be used for ballparking manual usability
```
$ cat /etc/systemd/system/munin-fcgi-html.service
[Unit]
Description=Munin FastCGI HTML
Documentation=man:spawn-fcgi
[Service]
Type=forking
PIDFile=/run/munin/fcgi-html.pid
ExecStart=/usr/bin/spawn-fcgi -s /run/munin/fcgi-html.sock -U www-data -u munin -g munin /var/www/cgi-bin/munin-cgi-html -P /run/munin/fcgi-html.pid
[Install]
WantedBy=multi-user.target
```
Rotonen
2018-11-24 19:20:06
and that's just a symlink `/var/www/cgi-bin/munin-cgi-html -> /usr/lib/munin/cgi/munin-cgi-html`
Rotonen
2018-11-24 19:20:34
and here's the documentation for that
http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI
Rotonen
2018-11-24 19:20:51
if you want your munin to rely on cgi for generating the html, you need to tell it to use that as the generation strategy
Rotonen
2018-11-24 19:21:00
let's do that first as that's a bit easier than the graphs
Rotonen
2018-11-24 19:21:45
and as i do not know which webfront you use, here are some relevant location snippets for nginx
```
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:/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:/run/munin/fcgi-html.sock;
include fastcgi_params;
}
```
Rotonen
2018-11-24 19:21:51
and you should cache those on disk for 5 minutes
Rotonen
2018-11-24 19:22:39
and here's a systemd example for wrapping the graphs
```
$ cat /etc/systemd/system/munin-fcgi-graph.service
[Unit]
Description=Munin FastCGI Graph
Documentation=man:spawn-fcgi
[Service]
Type=forking
PIDFile=/run/munin/fcgi-graph.pid
ExecStart=/usr/bin/spawn-fcgi -s /run/munin/fcgi-graph.sock -U www-data -u munin -g munin /var/www/cgi-bin/munin-cgi-graph -P /run/munin/fcgi-graph.pid
[Install]
WantedBy=multi-user.target
```
Rotonen
2018-11-24 19:22:58
and if you get that going for you, the interactive graphs will work
Rotonen
2018-11-24 19:24:43
so there you have all the facts assembled, i can help with specifics if you hit something
Rotonen
2018-11-24 19:28:50
i am on it.
fydel
2018-11-24 19:28:53
and of course only cache the html outputs, the graph ones need to be direct accesses to the cgi script
Rotonen
2018-11-24 19:29:04
i'll be on the computer all evening, you're not in a rush
Rotonen
2018-11-24 19:30:20
i am using apache2. same for apache instead of nginx?
fydel
2018-11-24 19:30:48
well, yes, but you need to figure out those redirects of how to talk to the unix domain sockets of the fcgi wrapped scripts
Rotonen
2018-11-24 19:31:10
fcgi wrappers can also usually provide you a tcp interface if that makes life easier to you
Rotonen
2018-11-24 19:40:48
oh, man. that's too much for me.
fydel
2018-11-24 19:41:29
i am not into webserver and this cgi stuff.
fydel
2018-11-24 19:41:52
and i never used systemd before.
fydel
2018-11-24 19:45:53
i have to read up about this stuff before we can continue.
fydel
2018-11-24 19:47:47
well, you have it archived here now
Rotonen
2018-11-24 19:48:03
but munin is just a pile of perl and cgi on top of rrd and rrdcached
Rotonen
2018-11-24 19:48:18
did your munin master runs get faster at least?
Rotonen
2018-11-24 19:49:27
yes. thanks so far.
fydel
2018-11-24 19:50:18
no. :disappointed:
fydel