LinuxInstallation - Munin - Trac
Installation of Munin node/master ¶
Table of Contents
- Installation on Debian/Ubuntu
- Installation on Red Hat Enterprise 3 (RHEL3)
- Installation on Red Hat Enterprise 4 (RHEL4)
- Installation on Red Hat Enterprise 5 (RHEL5)
- Installation on CentOS 5
- Installation on Fedora Core 4 (FC4)
- Installation on Fedora Core 6 (FC6)
- Munin on SuSE
- Munin on SuSE Linux Enterprise
- Munin on openSUSE
- Munin on SuSE Linux (Pro)
- Munin and SELinux
- Munin Without Apache
- Without internet connection (using virtual box)
Remember: To do munin surveillance of a Munin master, you must install and run munin-node on the master-server as well as munin.
Installation on Debian/Ubuntu ¶
If you are running Debian/Ubuntu, you are in luck.
Munin node ¶
Since "Munin Node" is in the standard repository, you can just type:
# apt-get install munin-nodeMunin master ¶
Since "Munin master" is in the standard repository, you can just type:
# apt-get install muninInstallation on Red Hat Enterprise 3 (RHEL3) ¶
Munin node ¶
On my freshly installed RHEL3, the munin-node package require these dependecies:
# rpm -Uvh munin-node-1.2.5-1rhel3.noarch.rpm error: Failed dependencies: perl(Net::SNMP) is needed by munin-node-1.2.5-1rhel3 perl(Net::Server::Fork) is needed by munin-node-1.2.5-1rhel3 perl-Net-Server is needed by munin-node-1.2.5-1rhel3 sysstat is needed by munin-node-1.2.5-1rhel3 Suggested resolutions: /var/spool/up2date/sysstat-5.0.5-5.rhel3.i386.rpmNow, the "sysstat" package are located on disc 3 of the installation set, so that one is easy. The other packages can be downloaded from Dag Wieers excellent RPM repository. You migh want to head over there and download the latest versions or if you're running the x86_64 version of RHEL3:
- http://dag.wieers.com/rpm/packages/perl-Net-SNMP/
- http://dag.wieers.com/rpm/packages/perl-Crypt-DES/ (required by perl-Net-SNMP)
- http://dag.wieers.com/rpm/packages/perl-Socket6/ (required by perl-Net-SNMP)
- http://dag.wieers.com/rpm/packages/perl-Net-Server/
# rpm -Uvh sysstat-5.0.5-7.rhel4.i386.rpm Preparing... ########################################### [100%] 1:sysstat ########################################### [100%] # wget http://dag.wieers.com/rpm/packages/perl-Net-SNMP/perl-Net-SNMP-5.2.0-1.1.el3.rf.noarch.rpm # wget http://dag.wieers.com/rpm/packages/perl-Crypt-DES/perl-Crypt-DES-2.05-3.1.fc3.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/perl-Socket6/perl-Socket6-0.19-1.1.fc3.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/perl-Net-Server/perl-Net-Server-0.94-1.el3.rf.noarch.rpm # rpm -Uvh *.rpm Preparing... ########################################### [100%] 1:perl-Socket6 ########################################### [ 25%] 2:perl-Crypt-DES ########################################### [ 50%] 3:perl-Net-SNMP ########################################### [ 75%] 4:perl-Net-Server ########################################### [100%] 5:munin-node ########################################### [100%]That's it! You will now most likly change the /etc/munin/munin-node.conf to accept connection from your Munin master.
Munin master ¶
On my freshly installed RHEL3, the munin package requires these dependecies:
# rpm -Uvh munin-1.2.5-1rhel3.noarch.rpm error: Failed dependencies: perl(HTML::Template) is needed by munin-1.2.5-1rhel3 perl(RRDs) is needed by munin-1.2.5-1rhel3 perl-HTML-Template is needed by munin-1.2.5-1rhel3 perl-Net-SNMP is needed by munin-1.2.5-1rhel3 perl-Net-Server is needed by munin-1.2.5-1rhel3 rrdtool is needed by munin-1.2.5-1rhel3All of these packages can be downloaded from Dag Wieers excellent RPM repository. You migh want to head over there and download the latest versions or if you're running the x86_64 version of RHEL3:
- http://dag.wieers.com/rpm/packages/perl-HTML-Template/
- http://dag.wieers.com/rpm/packages/rrdtool/
- http://dag.wieers.com/rpm/packages/perl-Net-SNMP/
- http://dag.wieers.com/rpm/packages/perl-Net-Server/
# wget http://dag.wieers.com/rpm/packages/perl-HTML-Template/perl-HTML-Template-2.8-1.1.fc3.rf.noarch.rpm # wget http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.2.18-1.el3.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.2.18-1.el3.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/perl-Net-SNMP/perl-Net-SNMP-5.2.0-1.1.el3.rf.noarch.rpm # wget http://dag.wieers.com/rpm/packages/perl-Net-Server/perl-Net-Server-0.94-1.el3.rf.noarch.rpm # rpm -Uvh Preparing... ########################################### [100%] 1:perl-HTML-Template ########################################### [ 25%] 2:rrdtool ########################################### [ 50%] 3:perl-rrdtool ########################################### [ 75%] 4:perl-Net-SNMP ########################################### [ 75%] 5:perl-Net-Server ########################################### [100%] 6:munin ########################################### [100%]That's it! You'll will now probably start by looking at /etc/munin/munin.conf
Installation on Red Hat Enterprise 4 (RHEL4) ¶
Munin node ¶
On my freshly installed RHEL4, the munin-node package requires these dependencies:
# rpm -Uvh munin-node-1.2.5-1rhel4.noarch.rpm error: Failed dependencies: perl(Net::SNMP) is needed by munin-node-1.2.5-1rhel4.noarch perl(Net::Server::Fork) is needed by munin-node-1.2.5-1rhel4.noarch perl-Net-Server is needed by munin-node-1.2.5-1rhel4.noarch sysstat is needed by munin-node-1.2.5-1rhel4.noarch Suggested resolutions: sysstat-5.0.5-7.rhel4.i386.rpmNow, the "sysstat" package are easy - you'll find that on the installation CDs. The other packages can be downloaded from Dag Wieers excellent RPM repository. You migh want to head over there and download the latest versions or if you're running the x86_64 version of RHEL4:
- http://dag.wieers.com/rpm/packages/perl-Net-SNMP/
- http://dag.wieers.com/rpm/packages/perl-Crypt-DES/ (required by perl-Net-SNMP)
- http://dag.wieers.com/rpm/packages/perl-Socket6/ (required by perl-Net-SNMP)
- http://dag.wieers.com/rpm/packages/perl-Net-Server/
# rpm -Uvh sysstat-5.0.5-7.rhel4.i386.rpm Preparing... ########################################### [100%] 1:sysstat ########################################### [100%] # wget http://dag.wieers.com/rpm/packages/perl-Net-SNMP/perl-Net-SNMP-5.2.0-1.2.el4.rf.noarch.rpm # wget http://dag.wieers.com/rpm/packages/perl-Crypt-DES/perl-Crypt-DES-2.05-3.2.el4.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/perl-Socket6/perl-Socket6-0.19-1.2.el4.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/perl-Net-Server/perl-Net-Server-0.94-1.el4.rf.noarch.rpm # rpm -Uvh * Preparing... ########################################### [100%] 1:perl-Net-Server ########################################### [ 20%] 2:perl-Socket6 ########################################### [ 40%] 3:perl-Crypt-DES ########################################### [ 60%] 4:perl-Net-SNMP ########################################### [ 80%] 5:munin-node ########################################### [100%]That's it! You will now most likly change the /etc/munin/munin.conf to accept connection from your Munin master.
Munin master ¶
On my freshly installed RHEL4, the munin package require these dependencies:
# rpm -Uvh munin-1.2.5-1rhel4.noarch.rpm error: Failed dependencies: perl(HTML::Template) is needed by munin-1.2.5-1rhel4.noarch perl(RRDs) is needed by munin-1.2.5-1rhel4.noarch perl-HTML-Template is needed by munin-1.2.5-1rhel4.noarch perl-Net-SNMP is needed by munin-1.2.5-1rhel4.noarch perl-Net-Server is needed by munin-1.2.5-1rhel4.noarch rrdtool is needed by munin-1.2.5-1rhel4.noarchAll of these packages can be downloaded from Dag Wieers excellent RPM repository. You migh want to head over there and download the latest versions or if you're running the x86_64 version of RHEL4:
- http://dag.wieers.com/rpm/packages/perl-HTML-Template/
- http://dag.wieers.com/rpm/packages/rrdtool/
- http://dag.wieers.com/rpm/packages/perl-Net-SNMP/
- http://dag.wieers.com/rpm/packages/perl-Net-Server/
# wget http://dag.wieers.com/rpm/packages/perl-HTML-Template/perl-HTML-Template-2.8-1.2.el4.rf.noarch.rpm # wget http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.2.18-1.el4.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.2.18-1.el4.rf.i386.rpm # wget http://dag.wieers.com/rpm/packages/perl-Net-SNMP/perl-Net-SNMP-5.2.0-1.2.el4.rf.noarch.rpm # wget http://dag.wieers.com/rpm/packages/perl-Net-Server/perl-Net-Server-0.94-1.el4.rf.noarch.rpm # rpm -Uvh * Preparing... ########################################### [100%] 1:perl-HTML-Template ########################################### [ 25%] 2:rrdtool ########################################### [ 50%] 3:perl-rrdtool ########################################### [ 75%] 4:perl-Net-SNMP ########################################### [ 75%] 5:perl-Net-Server ########################################### [100%] 6:munin ########################################### [100%]That's it! You'll will now probably start by looking at /etc/munin/munin.conf
Installation on Red Hat Enterprise 5 (RHEL5) ¶
The installation procedure should be the same as for RHEL4 and Dag Wieers repositories have RPM's for RHEL5
- http://dag.wieers.com/rpm/packages/perl-HTML-Template/
- http://dag.wieers.com/rpm/packages/rrdtool/
- http://dag.wieers.com/rpm/packages/perl-Net-SNMP/
- http://dag.wieers.com/rpm/packages/perl-Net-Server/
Installation on CentOS 5 ¶
The easiest way to go about this is to install a YUM repository that contains it. The two most popular are the EPEL YUM Repository from the Fedora Core team, and the Dag Wieers YUM repository
Once the repository is installed, just use YUM to install the munin-node RPMs on each system you want to monitor, and both that and the munin RPM on your Munin master.
Installing the EPEL YUM Repository ¶
Just execute this command as root :
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpmThat is of course if you are running CentOS 5.3. Change the file name to 5.2 if you are running that release, and similarly for newer releases.
Installing the Dag Wieers YUM Repository ¶
Just create the following file with the contents show : /etc/yum.repos.d/dag.repo
[dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt enabled=1Installing Client and Server ¶
On the server, just do:
yum -y install munin munin-nodeAnd on each client (or "node" as munin calls them):
yum -y install munin-nodeNote that the node install can take a really long time to complete - just be patient and it will.
Installation on Fedora Core 4 (FC4) ¶
Since the third-party docs show installations on Debian, here are steps install Munin on Fedora Core 4:
Please note that munin is included in Fedora Extras (rrdtool is in fedora core) and can be installed with yum. These instructions are for people that want a custom install.
Munin node ¶
- You must run these commands as root.
/usr/sbin/useradd munin make install-node install-node-plugins /opt/munin/sbin/munin-node-configure --shell | sh perl -MCPAN -e "install Net::Server::Fork" echo allow ^123\.123\.123\.123$ >> /etc/opt/munin/munin-node.conf /opt/munin/sbin/munin-nodeMunin master ¶
- Start with the original commands in the INSTALL file included in the dist.
- You must run these commands as root.
perl -MCPAN -e "install HTML::Template"
- Install RRDtool http://oss.oetiker.ch/rrdtool/
- Install libart and freetype2
- You'll probably need to change these lines in the RRDtool configure script:
CPPFLAGS="$CPPFLAGS -I/usr/local/include/freetype2" CPPFLAGS="$CPPFLAGS -I/usr/local/include/libart-2.0"
- Add this line to the beginning of /opt/munin/bin/munin-cron (be sure to change to your version number)
export PERL5LIB=$PERL5LIB:/usr/local/rrdtool-1.2.15/lib/perl/5.X.X/i386-linux-thread-multi
- Add the binary to the munin user crontab:
*/5 * * * * /opt/munin/bin/munin-cronInstallation on Fedora Core 6 (FC6) ¶
The installation on FC6 is a breeze.
Munin node ¶
You can use yum to install munin-node:
# yum install munin-node Loading "installonlyn" plugin Setting up Install Process Setting up repositories Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for munin-node to pack into transaction set. munin-node-1.2.5-1.fc6.no 100% |=========================| 23 kB 00:02 ---> Package munin-node.noarch 0:1.2.5-1.fc6 set to be updated --> Running transaction check --> Processing Dependency: perl(LWP::Simple) for package: munin-node ...Munin master ¶
You can use "yum" to install munin:
# yum install munin Loading "installonlyn" plugin Setting up Install Process Setting up repositories Reading repository metadata in from local files Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for munin to pack into transaction set. munin-1.2.5-1.fc6.noarch. 100% |=========================| 10 kB 00:00 ---> Package munin.noarch 0:1.2.5-1.fc6 set to be updated --> Running transaction check ...Munin on SuSE ¶
Munin on SuSE Linux Enterprise ¶
For SuSE Linux Enterprise, use the RPM packages provided at SourceForge.net
Munin on openSUSE ¶
Munin is packaged for openSUSE (and previous versions of SuSE Linux) by the Packman project.
There are a number of methods for adding munin to openSUSE 10.2/10.3:
# Use YaST -> Software -> Community Repositories and select Packman
# Add Packman as an additional YaST Package Repository in YaST -> Software -> Software Repositories
# Use 1 click install (installs both the munin and munin-node packages)Install munin using the YaST -> Software -> Software Management or by using zypper:
# zypper in munin munin-node * Reading repository 'Packman Repository' cache * Reading repository 'openSUSE-10.3-FTP 10.3' cache * Reading repository 'openSUSE-10.3-Updates' cache * Reading installed packages [100%] The following NEW packages are going to be installed: munin munin-node Overall download size: 569.3 K. After the operation, additional 1.3 M will be used. Continue? [yes/no]: yes Downloading package munin-1.2.5-0.pm.1.noarch, 432.1 K (805.0 K unpacked) Downloading: munin-1.2.5-0.pm.1.noarch.rpm * Downloading [100%] * Installing: munin-1.2.5-0.pm.1 [100%] Downloading package munin-node-1.2.5-0.pm.1.noarch, 137.3 K (519.3 K unpacked) Downloading: munin-node-1.2.5-0.pm.1.noarch.rpm * Downloading [100%] * Installing: munin-node-1.2.5-0.pm.1 [100%]The zypper command will work for most (if not all) versions of OpenSUSE through at least 11.4.
Munin on SuSE Linux (Pro) ¶
There are RPM packages for SuSE Linux 10.0 and 10.1 at SourceForge.net, or you can use the Packman build of the packages by adding Packman to your YaST -> Software -> Installation Source and install munin and munin-node as ordinary SuSE Linux packages in YaST.
Munin and SELinux ¶
Running Munin alongside SELinux is no problem as long as the "targeted" policy are beeing used. The "targeted" policy protects only a limited set of exposed daemons (apache, bind, .. etc.). All other processes are running in a default security context (unconfined_t) which behaves as if SELinux was turned off.
Be sure to install munin, as described above, when SELinux is turned on. If not, you must "relabel" the security context on the newly installed files (and other files that may have been changed/written):
# restorecon -v -R /Or, the recommended method:
# touch /.autorelabelAnd reboot. This way the security context are changed in a early stage at the boot process. Be sure to set SELINUXTYPE=targeted in /etc/selinux/config before you reboot.
Munin Without Apache ¶
If you don't run an Apache Web server you can still run Munin. I'm running with Resin (a Java web server from www.caucho.com) and the configuration is relatively simple. Here's a webapp definition:
<web-app> <display-name>Munin</display-name> <description>Monitoring Server Based on RRD Tool</description> <welcome-file-list>index.html</welcome-file-list> <!-- optional access control --> <authenticator> <type>com.caucho.server.security.XmlAuthenticator</type> <init> <user>username:password:munin</user> <password-digest>none</password-digest> </init> </authenticator> <login-config> <auth-method>basic</auth-method> </login-config> <security-constraint url-pattern="/*" role-name="munin"/> <servlet servlet-name="cgiservlet" servlet-class="com.caucho.servlets.CGIServlet" /> <servlet-mapping url-pattern="/cgi/munin-cgi-graph" servlet-name="cgiservlet" /> <path-mapping url-pattern="/*" real-path="/var/www/html/munin" /> </web-app>Without internet connection (using virtual box) ¶
Useful when you want to install munin on machine(s) where you do not have an internet connection. Or you want to automate munin installation so you can use it in many machines.
Howto ¶
- Install Virtual Box, on a machine where you DO have an internet connection. See Virtual Box documentation.
- Create an instance of Virtual Box.
- Replicate environment (OS with all optional applications) of the machine where you wish to install munin on this instance.
- If you are creating one from scratch, you would need the OS installable (standard CD/DVD,...).
- Start the virtual box instance.
- Follow the process prescribed above to download the dependent rpms & perl modules (inside the virtual instance).
- Create your own package.
Tips ¶
- Virtual Box keeps everything related to an instance of it in a single image file (*.vdi). If you can get your hands on one of those you can create the instance by specifying path to that file.
- For replicating the environment in virtual box, you primarily need the same OS version and the perl version that you have on your actual machine. Rest of the applications usually do not cause any problems if not installed.
- Munin dependencies are primarily perl modules. Using CPAN (as described at bottom of INSTALL file that comes along with every munin package) is the best way to get these.
A quicky on CPAN ¶
For perl noobs like me:
- You would usually need to set some config params so that CPAN
- automatically downloads and installs (prerequisites_policy) the dependencies of the perl modules (or distribution) you are trying to install
- knows how to connect to internet (http_proxy if there is one)
- where to look for the perl modules (urllist).
- After this it's a simple "install <module>" command.
- For some names (like MailTools?) you'll get don't know what is it, these could be perl distributions (more than on modules' package). You need to use a little different command for that.
- Finally everything is available in the directory pointed by the parameter keep_source_where.
(Note that if you're getting Munin from a package repository, the odds are fairly good that the requisite perl modules are also in that repository, and a tool like yum, apt-get, or zypper will pull them in for you.)
# cpan cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help. cpan[5]> o conf .........lists current configuration...... cpan[6]> o conf http_proxy http://10.20.30.40:8080 cpan[7]> o conf prerequisites_policy follow cpan[8]> o conf push http://ppm.activestate.com/CPAN cpan[9]> o conf push http://cpan.perl.org cpan[10]> o conf commit cpan[10]> o conf keep_source_where keep_source_where [/home/kash/cpan/sources] cpan[11]> install Net::Server::Fork ... cpan[12]> install <other modules> ... cpan[13]> cpan[13]> install MailTools Warning: Cannot install MailTools, don't know what it is. Try the command i /MailTools/ to find objects with matching identifiers. cpan[14]> i /Mailtools/ Distribution id = M/MA/MARKOV/MailTools-2.07.tar.gz CPAN_USERID MARKOV (Mark Overmeer <mark@overmeer.net>) CALLED_FOR M/MA/MARKOV/MailTools-2.07.tar.gz CHECKSUM_STATUS OK CONTAINSMODS Mail::Address Mail::Cap Mail::Field Mail::Field::AddrList Mail::Field::Date Mail::Field::Generic Mail::Filter Mail::Header Mail::Internet Mail::Mailer Mail::Mailer::qmail Mail::Mailer::rfc822 Mail::Mailer::sendmail Mail::Mailer::smtp Mail::Mailer::smtps Mail::Mailer::testfile Mail::Send UPLOAD_DATE 2010-10-01 archived tar ...... cpan[15]> install M/MA/MARKOV/MailTools-2.07.tar.gz .... cpan[13]> quit # find /home/kash/cpan/sources/authors/id/ -name *.tar.gz /root/.cpan/sources/authors/id/G/GA/GAAS/Digest-SHA1-2.13.tar.gz /root/.cpan/sources/authors/id/G/GA/GAAS/IO-String-1.08.tar.gz /root/.cpan/sources/authors/id/G/GA/GAAS/Digest-HMAC-1.02.tar.gz /root/.cpan/sources/authors/id/G/GA/GAAS/Digest-MD5-2.51.tar.gz /root/.cpan/sources/authors/id/G/GB/GBARR/Scalar-List-Utils-1.23.tar.gz /root/.cpan/sources/authors/id/G/GB/GBARR/TimeDate-1.20.tar.gz /root/.cpan/sources/authors/id/B/BS/BSUGARS/IPC-Shareable-0.60.tar.gz .... # mkdir munin_deps # for f in `find /root/.cpan/sources/authors/id/ -name *.tar.gz`; do cp $f munin_deps; done # echo "All perl modules and their dependents needed are now present in `pwd`/munin_deps"To install all the tar.gz files you can use standard interface. Here is a small script I wrote (works on RHEL).
attachment:install_perl_modules.shAttachments
- install_perl_modules.sh (3.2 kB) -
Sample script to install downloaded perl modules., added by thekashyap on 02/15/11 06:47:45.