# Monitoring Drupal with Munin — Liran Tal

How to monitor a Drupal website with Munin plugin for Nagios

Canonical: https://lirantal.com/blog/2013-04-03

![Cover artwork for Monitoring Drupal with Munin](/_astro/photo-1468956398224-6d6f66e22c35.BePqp3CW_Zj88Tk.jpg)

[Munin](http://munin-monitoring.org/) is a lightweight server/agent monitoring tool.
Basically, it works by installing agents on machines you wish to monitor and they report status messages to a munin server, which is another component (ofcourse both the server and agent can run on the same machine). Munin saves those status messages in it’s own data store and is integrated with [rrdtool](http://oss.oetiker.ch/rrdtool/) to produce [nice looking graphs](http://oss.oetiker.ch/rrdtool/gallery/index.en.html) which give you an overview of daily, weekly, monthly and yearly periodical reports.

## Munin In Drupal

Using Munin to monitor some internal Drupal statistics goes a long way regarding insight gathering of what’s going on your web application in real-time. While there are some munin related plugins to use on drupal.org I find it to be yet another module on top of already installed that I have and doesn’t really serve my need. End users can easily build their scripts to get the information they care about and this doesn’t need to exist within the Drupal app at all.

I’ve [forked](https://github.com/lirantal/contrib/tree/master/plugins/drupal) the munin’s contrib project on github and you can find a few scripts to get some nice and information from Drupal 6 already:

*   total files
*   total forums and comments
*   node distribution count
*   users online (total, anonymous vs registered users)
*   users total vs blocked users

And there’s nothing like an image to please the eye…

[![drupal\_online\_users](https://web.archive.org/web/20140703102650im_/http://enginx.com/wp-content/uploads/2013/08/drupal_online_users-300x169.png)](http://enginx.com/wp-content/uploads/2013/08/drupal_online_users.png)

All the code is here: [https://github.com/lirantal/contrib/tree/master/plugins/drupal](https://github.com/lirantal/contrib/tree/master/plugins/drupal)

## Installing Munin

We won’t dwell into the ins and outs of munin or it’s installation, as you can easily find out all of this information and more on [munin’s website](http://munin-monitoring.org/wiki/LinuxInstallation) and [Google](http://google.com/), but here’s a short guide on it anyway for CentOS or RedHat-based distributions.

If munin package isn’t available in your repository try adding using `rpmforge` (the following uses the RHEL5 64bit repositor):

```
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
```

On the machine that hosts the munin server (it also hosts the html web resources) you should install the munin package:

```
yum install munin
```

Edit /etc/munin/munin.conf and setup the local host if you’re hoping to monitor the munin server too:

```
[localhost]
address 127.0.0.1
use_node_name
```

Set a contact for alerts:

```
contact.liran.command mail -s "Munin notification" your.email@example.com
```

We’ll need to symlink the munin directory from where it installed to to your web directory and then we can create an alias for it too:

```
# add an alias for apache in /etc/httpd/conf/httpd.conf
Alias /munin /var/www/munin

Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
```

So far this was the munin server side of things. If the same machine needs to be monitored too or if you need to install the munin monitoring agent on another machine you need to install the munin-node package:

```
yum install munin-node perl-libwww-perl
```

On that machine you will then need to enable the plugins you wish to use to monitor services. This can be done by symlinking them to say

```
    /etc/munin/plugins

    and making sure they are set executable so that munin can run them. It comes with a hefty set of plugins by default, located probably at

    /usr/share/munin/plugins

    and you may need to tune plugins configuration using the main munin configuration file for the node at

    etc/munin/munin-node.conf
```

## More writing

[All writing](/blog)

*   Sep 5, 2026

    ### [Self-Hosting Hermes Agent with Matrix E2EE on Proxmox](/blog/self-host-hermes-agent-matrix-e2ee-proxmox)

*   Aug 2, 2026

    ### [The Practical Second Brain: Building an LLM-Operated Markdown Knowledge Graph](/blog/practical-second-brain-llm-markdown-knowledge-graph)

*   Aug 1, 2026

    ### [Building a Second Brain with LLMs and AI Agents](/blog/building-second-brain-llms-ai-agents)


* * *

Liran Tal is the author of the book [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/)

[Start Building Secure Node.js Applications](https://www.nodejs-security.com/)

 [![](/_astro/nodejs-secure-coding-book-3d-style.DiTWpzFs_Z3c7s1.png)](https://www.nodejs-security.com/)
