# Resource Monitoring The below commands will setup ```munin``` for monitoring resource utilization on your PiFrame. This is wholly optional but can provide insights if your PiFrame is exhibiting odd behavior. ## Important Notes * This setup will deploy a *dedicated instance* of ```lighttpd``` to handle access to the ```munin``` data. Given how lean ```lighttpd``` is on resources, this saves many hassles with virtual hosts and the like. * This setup uses cgi to generate ```munin``` graphs. The Raspberry Pi cpu can take awhile to generate graphs. Please be patient. This approach was chosen to keep ```munin``` from consuming resource generating graphs every time it collects statistics. This also helps prevent excessive disk writes to the micro sd card extending its life. ## Setup ``` sh apt install munin nano -w /etc/munin/munin.conf graph_strategy cgi html_strategy cron [piframe] address 127.0.0.1 use_node_name yes touch /var/log/munin/munin-cgi-graph.log chown munin: /var/log/munin/munin-cgi-graph.log munin-node-configure --shell # activate useful plugins sudo -sHu munin munin-cron # prime munin data systemctl enable --now munin-node systemctl restart munin-node cat > /etc/lighttpd/lighttpd-munin.conf < "/munin/" ) \$HTTP["url"] =~ "/munin-cgi/munin-cgi-graph" { alias.url += ( "/munin-cgi/munin-cgi-graph" => "/usr/lib/munin/cgi/munin-cgi-graph" ) cgi.assign = ( "" => "" ) } alias.url += ( "/munin/static" => "/etc/munin/static" ) alias.url += ( "/munin" => "/var/cache/munin/www" ) mimetype.assign = ( ".html" => "text/html", ".txt" => "text/plain", ".css" => "text/css", ".js" => "application/x-javascript", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".gif" => "image/gif", ".png" => "image/png", "" => "application/octet-stream" ) EOF cat > /etc/systemd/system/lighttpd-munin.service <