I also installed Munin on Kallobombus.
When I tried to zoom into graphs, I got an error: “You don’t have permission to access _munin-cgi_munin-cgi-graph/ch/alexschroeder.ch/load-pinpoint=1404336009,1404606009.png on this server.”
Edit `/etc/apache2/conf.d/munin` and find the section where it mentions _munin-cgi_munin-cgi-graph*. Comment the line that allows access from localhost, add the line allow access from all and uncomment the lines that force users to authenticate using a password.
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph <Location /munin-cgi/munin-cgi-graph> Order allow,deny # Allow from localhost 127.0.0.0/8 ::1 Allow from all AuthUserFile /etc/munin/munin-htpasswd AuthName "Munin" AuthType Basic require valid-user <IfModule mod_fastcgi.c> SetHandler fastcgi-script </IfModule> </Location>
Don’t forget:
sudo service apache2 restart
Later, I had more permission problems. The CGI images wouldn’t show up. When I clicked on the broken image icon, I saw the following error: `Can't open /var/log/munin/munin-cgi-graph.log (Permission denied) at /usr/share/perl5/Log/Log4perl/Appender/File.pm line 103.`
The CGI process runs as `www-data`. I checked `ls -l /var/log/munin` and noticed that the log file was missing and that the parent directory didn’t allow `www-data` to create files. I decided to create this log file manually:
sudo touch /var/log/munin/munin-cgi-graph.log sudo chown www-data.munin /var/log/munin/munin-cgi-graph.log
Retrying, I got the following error: `Could not draw graph "/var/lib/munin/cgi-tmp/munin-cgi-graph/ch/alexschroeder.ch/forks-pinpoint=1438048505,1438156505.png?&lower_limit=&upper_limit=&size_x=800&size_y=400"`
When I checked using `ls -l /var/lib/munin` I noticed that the directory was there but it belonged to `munin`. I therefore fixed it as follows:
sudo chown www-data.munin /var/lib/munin/cgi-tmp
I was having a problem with sendmail stats not being collected. Thanks to Enable Sendmail Mailstats by Marius Ducea, I found the problem.
First, figure out that sendmail_mailstats doesn��t work:
alex@kallobombus:/etc/munin/plugins$ sudo /usr/sbin/mailstats MSP statistics... mailstats: /var/lib/sendmail/sm-client.st: No such file or directory MTA statistics... mailstats: /var/lib/sendmail/sendmail.st: No such file or directory
Verify that sendmail’s config is correct:
alex@kallobombus:/etc/munin/plugins$ sudo grep StatusFile /etc/mail/sendmail.cf O StatusFile=/var/lib/sendmail/sendmail.st
Create the missing files—this is the fix!
alex@kallobombus:/etc/munin/plugins$ sudo touch /var/lib/sendmail/sm-client.st alex@kallobombus:/etc/munin/plugins$ sudo touch /var/lib/sendmail/sendmail.st
And now it works:
alex@kallobombus:/etc/munin/plugins$ sudo /usr/sbin/mailstats MSP statistics... Statistics from Sat Jul 5 11:56:24 2014 M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis msgsqur Mailer ===================================================================== T 0 0K 0 0K 0 0 0 C 0 0 0 MTA statistics... Statistics from Sat Jul 5 11:56:25 2014 M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis msgsqur Mailer ===================================================================== T 0 0K 0 0K 0 0 0 C 0 0 0
Marius also suggests the following in a cron job:
mailstats -p > /dev/null
I’ll add that to my Todo list.
Unfortunately I’m still not seeing sendmail on my Munin webpage after a restart. I tried various things, checked permissions, read the source code, tried again, restarted the munin service, googled for sendmail and munin problems... Then I noticed that fail2ban didn’t work either! That made me even more suspicious. I was missing something elementary.
I added the following to `/etc/munin/plugin-conf.d/munin-node`:
[sendmail_*] user munin
No effect.
Then finally, by chance, I saw a blog post talking about the installation of a plugin and it said:
sudo /etc/init.d/munin-node restart
Do you see the important part? We’re not restarting *munin*. We’re *restarting munin-node*. 😭
(Please contact me if you want to remove your comment.)
⁂
The file `/var/lib/sendmail/sm-client.st` unfortunately disappear after each reboot ;-(
– Thibs 2016-12-30 20:10 UTC
---
Sadly, I no longer use this setup, and so I have no `mailstats`.
– Alex Schroeder 2016-12-31 20:56 UTC