https://wiki.archlinux.org/api.php?action=feedcontributions&user=Dtajchreber&feedformat=atomArchWiki - User contributions [en]2024-03-28T23:24:56ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Munin&diff=112787Munin2010-07-29T03:21:25Z<p>Dtajchreber: munin-node-configure --shell only spits out the shell commands to create the soft links in /etc/munin/plugins. You need to pipe to a shell to actually execute them</p>
<hr />
<div>[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
'''''[http://munin-monitoring.org/ 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.''<br />
<br />
''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.''<br />
<br />
''Munin uses the excellent [http://oss.oetiker.ch/rrdtool/ 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-monitoring.org/]<br />
<br />
Simply put, Munin allows you to make graphs about system statistics. You can check out University of Oslo's [http://munin.ping.uio.no/ Munin install] to see some examples of what it can do.<br />
<br />
== Installation ==<br />
<br />
Munin relies on a client-server model. The client is munin-node, and the server is munin (referred as to "munin-master" in the documentation).<br />
<br />
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-monitoring.org/wiki/Documentation Munin documentation wiki].<br />
<br />
=== munin and munin-node ===<br />
<br />
There is currently a munin (munin-master) and a munin-node package in extra.<br />
<br />
# pacman -S munin munin-node<br />
<br />
=== Optional web server ===<br />
<br />
The following guide sets up Munin to generate static HTML and graph images and write them in a directory of your choosing. You can view these generated files locally with any web browser. If you want to view the generated files from a remote machine, then you want to install and configure one of the following web servers:<br />
<br />
*[[LAMP|Apache]]<br />
*[[Lighttpd]]<br />
*[[NginX]]<br />
<br />
Or one of the other servers found in the [[:Category:Web_Server_(English)|web server]] category.<br />
<br />
== Configuration ==<br />
<br />
=== Daemon ===<br />
<br />
Add the daemon to /etc/rc.conf:<br />
<br />
DAEMONS=(syslog-ng network netfs crond httpd '''munin-node''')<br />
<br />
=== Plugins ===<br />
<br />
Run munin-node-configure with the --suggest option to have Munin suggest plugins that it thinks will work on your installation:<br />
<br />
# munin-node-configure --suggest<br />
<br />
If there is a suggestion for a plugin you want to use, follow that suggestion and run the command again. When you are satisfied with the plugins suggested by munin-node-configure, run it with the --shell option to have the plugins configured:<br />
<br />
# munin-node-configure --shell | sh<br />
<br />
=== Directories ===<br />
<br />
Create a directory where the munin-master will write the generated HTML and graph images. The munin user must have write permission to this directory.<br />
<br />
/srv/http/munin is used below, so the generated output can be viewed at [http://localhost/munin/ http://localhost/munin/] provided that a web server is installed and running.<br />
<br />
# mkdir /srv/http/munin<br />
# chown munin:munin /srv/http/munin<br />
<br />
Uncomment the htmldir entry in /etc/munin/munin.conf and change it to the directory created in the previous step:<br />
<br />
htmldir /srv/http/munin<br />
<br />
=== Cron ===<br />
<br />
Run the following to have munin collect data and update the generated HTML and graph images every 5 minutes:<br />
<br />
# crontab /etc/munin/munin-cron-entry -u munin<br />
<br />
You can run also run monin-cron manually for testing purposes:<br />
<br />
# su - munin --shell=/bin/bash<br />
$ munin-cron<br />
<br />
== Testing ==<br />
<br />
Munin should be able to run now. To make sure everything works, start munin-node:<br />
<br />
#/etc/rc.d/munin-node start<br />
<br />
Then run munin-cron manually to generate the HTML and graph images:<br />
<br />
# su - munin --shell=/bin/bash<br />
$ munin-cron<br />
<br />
And finally test the interface by pointing your browser to the output directory or [http://localhost/munin/ http://localhost/munin/].<br />
<br />
{{Note|It might take a while for the graphs to have data, so be patient. Wait for about 30 minutes to an hour.}}<br />
<br />
== Plugins ==<br />
<br />
There are many Munin plugins out there just waiting to be installed. The [http://muninexchange.projects.linpro.no/ MuninExchange] is an excellent place to start looking, and if you can't find a plugin that does what you want it's easy to write your own. Have a look at [http://munin-monitoring.org/wiki/HowToWritePlugins HowToWritePlugins] at the Munin documentation wiki to learn how.<br />
<br />
=== Adding ===<br />
<br />
Basically all plugins are added in the following manner (although there are exceptions, review each plugin!):<br />
<br />
Download a plugin, then copy or move it to /usr/lib/munin/plugins<br />
<br />
# cp <plugin> /usr/lib/munin/plugins/<br />
<br />
Then link the plugin to /etc/munin/plugins:<br />
<br />
# ln -s /usr/lib/munin/plugins/<plugin> /etc/munin/plugins/<plugin><br />
<br />
{{Note|Some plugins - known as wildcard plugins - can be used with multiple devices at once by linking them with different names. These plugins end with an underscore and are linked as <plugin>_<device> to be used on <device>. See the if_ plugin for an example.}}<br />
<br />
Now test your plugin. You do not need to use the full path to the plugin, munin-run should be able to figure it out:<br />
<br />
# munin-run <plugin><br />
<br />
And restart munin-node:<br />
<br />
# /etc/rc.d/munin-node restart<br />
<br />
Finally, refresh the web page.<br />
<br />
=== Removing ===<br />
<br />
If you want to remove a plugin, simply delete the linked file in /etc/munin/plugins - there is no need to remove the plugin from /usr/lib/munin/plugins.<br />
<br />
# rm /etc/munin/plugins/<plugin></div>Dtajchreber