Apache logs not showing in Munin

My munin did not show the graphs for apache_accesses, apache_processes or apache_volume. The logs from munin (/var/log/munin/munin-node.log) showed the following errors:

Error output from apache_accesses:
     LWP::UserAgent not found at /etc/munin/plugins/apache_accesses line 86.
 Service 'apache_accesses' exited with status 2/0.
 Error output from apache_processes:
     LWP::UserAgent not found at /etc/munin/plugins/apache_processes line 92.
 Service 'apache_processes' exited with status 2/0.
 Error output from apache_volume:
     LWP::UserAgent not found at /etc/munin/plugins/apache_volume line 86.
 Service 'apache_volume' exited with status 2/0.

A little digging in those plugins, showed up the fact that you can “test” them by just running them with the” autoconf” parameter, and if everything went ok, it would output “yes”, but mine did not. The output was:

/var/log/munin# /etc/munin/plugins/apache_accesses autoconf
no (apache server-status not found. check if mod_status is enabled)

I had in mods-enabled the server status mod, but it wouldn’t recognize it. I then compared the configuration from that server to another one, which was working, and the only difference between them was that the one not working did not have an apache2 default vhost. After i added that everything was fine.

I thing the plugin checks http://localhost/server-status?auto to get the status, and how i did not have a default vhost, the link was not working.

Hope this helps somebody!

5 thoughts on “Apache logs not showing in Munin

      1. freelancer486

        If you don’t want to set up a default or have rewrite rules that are doing other things to the default vhost, consider this option.

        1. Test the URL where you have the apache status configured from the machine that you are doing your munin reporting from.

        lynx http://www.MYDOMAIN.COM/server-status

        If you connect successfully, continue, otherwise check your config to ensure status is enabled and allowed from the server running Munin.

        2. Create the file (if it does not already exist) /etc/munin/plugin-conf.d/apache_

        with the following contents

        [apache_*]
        env.url http://www.YOURDOMAIN.COM/server-status?auto

        3. Restart munin-node

        4. Wait 20 minutes or so and recheck your apache status in munin.

        While you wait, you can confirm that the munin apache modules are correctly configured by running


        munin-run apache_accesses

        You should get back something that looks like
        accesses80.value 36583347

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *