Difference between revisions of "Munin"

From ArchWiki
Jump to: navigation, search
(Test the Web Page)
m (reorganized)
Line 1: Line 1:
 
[[Category:Office (English)]]
 
[[Category:Office (English)]]
== Installing Munin ==
 
=== What is Munin? ===
 
 
 
"Munin the monitoring tool surveys all your computers and remembers what it saw. It presents all the information in graphs through a web interface. Its emphasis is on plug and play capabilities. After completing a installation a high number of monitoring plugins will be playing with no more effort.
 
"Munin the monitoring tool surveys all your computers and remembers what it saw. It presents all the information in graphs through a web interface. Its emphasis is on plug and play capabilities. After completing a installation a high number of monitoring plugins will be playing with no more effort.
  
Line 9: Line 6:
 
Munin uses the excellent RRDTool (written by Tobi Oetiker) and the framework is written in Perl, while plugins may be written in any language. Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data. It then stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs). "[http://munin.projects.linpro.no/ Munin]
 
Munin uses the excellent RRDTool (written by Tobi Oetiker) and the framework is written in Perl, while plugins may be written in any language. Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data. It then stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs). "[http://munin.projects.linpro.no/ Munin]
  
Munin allows you to make pretty graphs about a systems statistics. You like pretty graphs, right?
+
Simply put, munin allows you to make graphs about a systems statistics. See a running [http://munin.ping.uio.no/ munin example]
  
[http://munin.ping.uio.no/ Like to see a running example?]
+
== Installation ==
  
=== Initial Notes ===
+
Munin relies on using a client-server model. The client is munin-node, and the server is munin (refered to "munin-master" in the documentation). You ''must'' have munin-node and munin-master installed for this installation to work.
 +
 
 +
You will only need to install munin-master on a single machine. But munin-node will need to be installed on all machines you wish to monitor. This article will focus on a single machine installation. Further documentation may be found on the [http://munin.projects.linpro.no/wiki/Documentation munin documentation wiki].
  
 
The following guide sets up a munin under a directory beneath the html root.
 
The following guide sets up a munin under a directory beneath the html root.
  
==== Apache Notes ====
+
===Dependencies===
  
The html root is located under /srv/http. This directory may not be created by default, so create it if not.
+
Munin relies on the following:
  #mkdir -p /srv/http
+
# pacman -S apache php php-apache
apache also creates (or uses) the user account and group of http:http.
+
  #chown http:http /srv/http
+
  
All of these settings can be changed in the file
+
Add an entry to your rc.conf:
   /etc/httpd/conf/httpd.conf
+
   DAEMONS=(syslog-ng network netfs crond '''httpd''')
  
==== Munin Notes ====
+
Edit /etc/hosts.allow by adding the following line:
 +
  httpd:    ALL
  
Munin relies is built using a client-server model. The client is munin-node, and the server is munin (refered to "munin-master" in all documentation). You MUST have munin-node and munin-master installed for this installation to work.
+
'''Optional sanity check'''
  
You will only need to install munin-master on a single machine. But munin-node will need to be installed on all machines you wish to monitor. This page will focus on a single machine installation. Further documentation may be found on the [http://munin.projects.linpro.no/wiki/Documentation munin documentation wiki].
+
Start the webserver:
 +
  # /etc/rc.d/httpd start
  
== Installing apache and php ==
+
Create a test document:
=== apache and php ===
+
   # echo "Testing httpd" > /srv/http/index.html
Install
+
  #pacman -S apache php php-apache
+
Add an entry to your rc.conf
+
  DAEMONS=(syslog-ng network netfs crond '''httpd''')
+
Edit your /etc/hosts.allow (by adding the following line)
+
  httpd:    ALL
+
Start your webserver (''sanity check'')
+
  #/etc/rc.d/httpd start
+
Create a test document
+
   #echo "Testing httpd" > /srv/http/index.html
+
Open a web browser to http://127.0.0.1/, and you should see the test document.
+
  
If it didn't work try (and check again):
+
Open a web browser and access http://127.0.0.1/, you should see the test document.
chown -R http:http /var/run/httpd/
+
  
Stop the webserver
+
If it did not work try the following and check again:
  #/etc/rc.d/httpd stop
+
# chown -R http:http /var/run/httpd/
  
=== Configuration ===
+
Finally, stop the webserver:
 +
# /etc/rc.d/httpd stop
  
I left my httpd.conf alone, and munin is running. This probably isn't too secure. Maybe someone can update this section with a secure configuration.
+
==== Apache Notes ====
  
== Installing Munin ==
+
The html root is located under /srv/http. This directory may not be created by default, so create it if not present:
=== Installing via yaourt ===
+
# mkdir -p /srv/http
  
Currently there's a munin package in the AUR, and a munin-node package in extra, so ... [[yaourt]] is a great choice.
+
Apache also creates (or uses) the user account and group of http:http. Make sure apache has permissions on these directories:
 +
# chown http:http /srv/http
  
  $yaourt -S munin munin-node
+
All of these settings can be changed in the /etc/httpd/conf/httpd.conf.
  
Now go check your /srv/http/ there should be a munin directory.
+
=== Installing Munin ===
  
=== munin-master configuration ===
+
Currently there's a munin package in the [[AUR]], and a munin-node package in extra. Installing with [[yaourt]] is a great choice:
  
Run the following to have munin update every 5 minutes:
+
$ yaourt -S munin munin-node
  
  #crontab /etc/munin/munin-cron-entry -u munin
+
Now check /srv/http. There should be a munin directory.
  
=== Add munin-node your rc.conf ===
+
== Configuration ==
  
Add an entry to your rc.conf
+
Add the daemon to /etc/rc.conf:
  DAEMONS=(syslog-ng network netfs crond httpd '''munin-node''')
+
DAEMONS=(syslog-ng network netfs crond httpd '''munin-node''')
  
== Testing Your Installation ==
+
Optional: Run the following to have munin update every 5 minutes:
 +
# crontab /etc/munin/munin-cron-entry -u munin
  
Believe it or not, you're almost done!
+
== Testing the Installation ==
  
=== Start Your Services ===
+
Start the services:
  
  #/etc/rc.d/httpd start
+
#/etc/rc.d/httpd start
  #/etc/rc.d/munin-node start
+
#/etc/rc.d/munin-node start
  
=== Test the Web Page ===
+
Then test the interface by pointing your browser to:
 
+
Point your browser to:
+
  
 
   http://localhost/munin
 
   http://localhost/munin
  
You should see munin!
+
{{Note|It might take a while for the graphs to have data, so be patient. Wait about 30 minutes to an hour.}}
 
+
=== A Note About Update Frequency ===
+
 
+
It might take a while for the graphs to have data. So be patient. Wait about 30 mins to an hour.
+

Revision as of 22:19, 31 October 2009

"Munin the monitoring tool surveys all your computers and remembers what it saw. It presents all the information in graphs through a web interface. Its emphasis is on plug and play capabilities. After completing a installation a high number of monitoring plugins will be playing with no more effort.

Using Munin you can easily monitor the performance of your computers, networks, SANs, applications, weather measurements and whatever comes to mind. It makes it easy to determine "what's different today" when a performance problem crops up. It makes it easy to see how you're doing capacity-wise on any resources.

Munin uses the excellent RRDTool (written by Tobi Oetiker) and the framework is written in Perl, while plugins may be written in any language. Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data. It then stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs). "Munin

Simply put, munin allows you to make graphs about a systems statistics. See a running munin example

Installation

Munin relies on using a client-server model. The client is munin-node, and the server is munin (refered to "munin-master" in the documentation). You must have munin-node and munin-master installed for this installation to work.

You will only need to install munin-master on a single machine. But munin-node will need to be installed on all machines you wish to monitor. This article will focus on a single machine installation. Further documentation may be found on the munin documentation wiki.

The following guide sets up a munin under a directory beneath the html root.

Dependencies

Munin relies on the following:

# pacman -S apache php php-apache

Add an entry to your rc.conf:

 DAEMONS=(syslog-ng network netfs crond httpd)

Edit /etc/hosts.allow by adding the following line:

 httpd:    ALL

Optional sanity check

Start the webserver:

 # /etc/rc.d/httpd start

Create a test document:

 # echo "Testing httpd" > /srv/http/index.html

Open a web browser and access http://127.0.0.1/, you should see the test document.

If it did not work try the following and check again:

# chown -R http:http /var/run/httpd/

Finally, stop the webserver:

# /etc/rc.d/httpd stop

Apache Notes

The html root is located under /srv/http. This directory may not be created by default, so create it if not present:

# mkdir -p /srv/http

Apache also creates (or uses) the user account and group of http:http. Make sure apache has permissions on these directories:

# chown http:http /srv/http

All of these settings can be changed in the /etc/httpd/conf/httpd.conf.

Installing Munin

Currently there's a munin package in the AUR, and a munin-node package in extra. Installing with yaourt is a great choice:

$ yaourt -S munin munin-node

Now check /srv/http. There should be a munin directory.

Configuration

Add the daemon to /etc/rc.conf:

DAEMONS=(syslog-ng network netfs crond httpd munin-node)

Optional: Run the following to have munin update every 5 minutes:

# crontab /etc/munin/munin-cron-entry -u munin

Testing the Installation

Start the services:

#/etc/rc.d/httpd start
#/etc/rc.d/munin-node start

Then test the interface by pointing your browser to:

 http://localhost/munin
Note: It might take a while for the graphs to have data, so be patient. Wait about 30 minutes to an hour.