Install Munin on Solaris 10 in 11 minutes
This is a short guide on how to install
Requirements: Solaris 10, perl, gnu make, perl Net::Server package
First create group + user
root@mysol10 # groupaddmunin root@mysol10 # useraddmunin
We need gmake (GNU Make). Mine is under /usr/sfw/bin. — If you do not have it acquire on from: http://www.sunfreeware.com/
root@mysol10 # export PATH="/usr/sfw/bin/:$PATH"
Get
Gunzip and untar
root@mysol10 # cd /tmp/munin -1.2.5/
Edit Makefile configuration:
root@mysol10 # vi Makefile.config
The file should look something like this:
# This file specifies whereMunin will look for things after you've # run 'make' in the source directory. Modify it to suit your needs. # DESTDIR is empty during building, and optionally set to point to # a shadow tree during make install. # # the base of theMunin installation. # #PREFIX = $(DESTDIR)/opt/munin PREFIX = /usr/local/munin # WhereMunin keeps its configurations (server.conf, client.conf, ++) CONFDIR = /etc/munin # Server only - where to putmunin -cron BINDIR = $(PREFIX)/bin # Client only - where to putmunin -node,munin -node-configure, andmunin -run SBINDIR = $(PREFIX)/sbin # Where to put text and html documentation DOCDIR = $(PREFIX)/doc # Where to put man pages MANDIR = $(PREFIX)/man # Where to put internal binaries and plugin repository LIBDIR = $(PREFIX)/lib # Server only - Output directory HTMLDIR = $(PREFIX)/var/www CGIDIR = $(HTMLDIR)/cgi # Client only - Where to put RRD files and other intenal data DBDIR = /var/munin # Client only - Where plugins should put their states. Must be writable by # group "munin ", and should be preserved between reboots PLUGSTATE = $(DBDIR)/plugin-state # WhereMunin should place its logs. LOGDIR = /var/log/munin # Location of PID files and other statefiles. On the server, must be # writable by the user "munin ". STATEDIR = /var/run/munin # The perl interpreter to use PERL = $(shell which perl) # The python interpreter to use (used by some plugins) PYTHON = /usr/bin/env python # Server only - Where to install the perl libraries PERLLIB = $(DESTDIR)$(shell $(PERL) -V:sitelib | cut -d= -f2 | sed "s/[';]//g") # Client only - Install plugins for this architecture OSTYPE = $(shell uname | tr '[A-Z]' '[a-z]') # How to figure out the hostname. (Only used in default configuration # files) HOSTNAME = $(shell hostname) # What is the safest way to create a tempfile. # Default is to figure it out by testing various methods. # Replace this with a known platform-specific method MKTEMP = $(shell ./test-mktemp) #Munin version number. VERSION = $(shell cat RELEASE) # User to runmunin as USER =munin GROUP =munin # Default user to run the plugins as PLUGINUSER = nobody # Which command to use to check if the USER and GROUP to runMunin as, exists. GETENT = $(shell which getent || which true 2>/dev/null) CHECKUSER = $(shell $(GETENT) passwd $(USER) >/dev/null 2>/dev/null || (echo "echo User $(USER) nonexistant. Create the user and retry; exit 2")) CHECKGROUP = $(shell $(GETENT) group $(GROUP) >/dev/null 2>/dev/null || (echo "echo Group $(GROUP) nonexistant. Create the group and retry; exit 2")) CHOWN = chown CHMOD = chmod CHGRP = chgrp
Install…
root@mysol10 # gmake install-node install-node-plugins
Auto-configure plug-ins — this is just a quick hack. You probably want to do more accurate configuration afterwards.
root@mysol10 # /usr/local/munin /sbin/munin -node-configure --shell | sh
Works?
root@mysol10 # ./munin -node --help Can't locate Net/Server/Fork.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/i86pc-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/i86pc-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl) at ./munin -node line 130. BEGIN failed--compilation aborted at ./munin -node line 130.
Well we’ll need Net::Server: http://search.cpan.org/~rhandom/Net-Server-0.97/lib/Net/Server/Fork.pm
root@mysol10 # gunzip Net-Server-0.97.tar.gz root@mysol10 # tar xf Net-Server-0.97.tar root@mysol10 # cd Net-Server-0.97 root@mysol10 # perl Makefile.PL root@mysol10 # gmake root@mysol10 # gmake install root@mysol10 # cd /usr/local/munin /sbin/ root@mysol10 # /usr/local/munin /sbin/munin -node --help Usage: /usr/local/munin /sbin/munin -node [options] Options: --help View this message. --configUse as configuration file. [/etc/ munin /munin -node.conf] --[no]paranoia Only run plugins owned by root. Check permissions. [--noparanoia] --debug View debug messages. --version View version information.
Now that looks fine…
Lets start it:
root@mysol10 # /usr/local/munin /sbin/munin -node
Is it running?
root@mysol10 # ps -e | grepmunin 18081 ? 0:00munin -no
OK for me… What about port?
root@mysol10 # netstat -n -a | grep 4949
*.4949 *.* 0 0 49152 0 LISTEN
Perfect.
How about fetching some data?
root@mysol10 # telnet localhost 4949 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. #munin node at mysol10 fetch cpu waitio.value 0 idle.value 8948631881 system.value 8593154 user.value 919089 .
Done.
make command is not working in my solaris server.I have installed the make package for spark by pkgadd -d [make.1.v-pkg name] command.Is it the only command to add package in Solaris or ?
Please help me…
You need GUN make instead of the default Solaris make. You can obtain it from here: http://www.sunfreeware.com/
There is also a description on how to install a package (left frame: Downloading/Installation).
After the installation, You should add those executables to PATH – mine was at /usr/sfw/bin/
Regards,
L.
K.gmake is the command for GNU Make ?
Ok..thnakz a lot ,got it.
Thankz for the help.
Hai…one more help i need.
i made path entry for the installed package in solaris server.now i want make those entries permanently.
Which file i have to edit for this purpose ? can u help me to solve this prob ?
What do you mean how to make executables accessible from anywhere? Or maybe how to make munin-node start at bootstrap?
Most people are other people. Their thoughts are someone else’s opinions, their lives a mimicry, their passions a quotation.
Hello, you have on your search?
A very uncomfortable all the time to search for information manually.
The search is on. See top of the page at right.
Hi Lóránd,
Thanks for your great HowTo which worked out smoothly!
One question last is, if and how you or anybody reading has got the munin-server running under Solaris?
Best regards, Jan
Hi Jan!
Actually we do not run munin-server on Solaris, just the node. To be even more precise, we are just collecting data from the node with our very own application.
I hope you’ll be successful with munin-server install. Anyhow let us know whatever came out.
Regards,
L.
Hi Lóránd,
Sorry I gave it up to install the munin server under Solaris 9 at the moment.
Best regards, Jan
Hi Lóránd,
Ok I got it done – shouldn’t have said `never` before.
(Note: I use http://www.blastwave.org/packages.php for GNUizing my system. I found SunFreeWare an oxymoron by name (beneath it was very outdated and small as my box was set up), as GNU is either free ware nor Sun’s Freeware. ,-) Therefor are the paths /opt/csw and not /opt/sfw and the CSW/Blastwave version of pkg-get install gnuprogram. To call the GNU versions directly someone can use gtar instead of tar and so on.)
cd /usr/local/src
gtar xzf munin_1.3.4.tar.gz
cd munin_1.3.4
Edit Makefile.config as described above and fitting into your Solaris Operating Environment. Take special attention to the Web directory settings. (Munin will place an .htaccess there but you may set it better into httpd.conf directly and secure it due https.)
On Solaris 9 I had to set the PERLLIB via hand to got the Munin-server installed!
PERLIB = /opt/csw/share/perl/5.8.8/Munin
This mainly did the trick. It places Munin::Plugin.pm aka as Munin/Plugin.pm into the Perl @INC.
(This one is also needed for some plugins as postfix_mailvolume to work.)
Gmake install-main builds also the plugins as in `gmake install-node.
gmake install-main install-node-plugins
Configure the automatic configurable plugins.
/usr/local/munin/sbin/munin-node-configure –shell | sh
Start it as here and above.
/usr/local/munin/sbin/munin-node
(For restarts e.g. after configuring more plugins via hand grep and kill munin-node and start again.)
Init scripts and mor can be found here:
/usr/local/src/munin-1.3.4/build/resources
apache-cgi.conf
hpux-init.d_munin-node
hpux-rc.config.d_muninconf
linux-cron.d_munin
linux-cron.d_munin-node
solaris-init.d_munin-node
cp /usr/local/src/munin-1.3.4/build/resources/solaris-init.d_munin-node /etc/init.d/munin-node
chmod u+x /etc/init.d/munin-node
ln -s /etc/init.d/munin-node /etc/rc3.d/K99munin-node
ln -s /etc/init.d/munin-node /etc/rc0.d/K99munin-node
ln -s /etc/init.d/munin-node /etc/rc1.d/K99munin-node
ln -s /etc/init.d/munin-node /etc/rcS.d/K99munin-node
Create a symlink to be able to swap Munin versions.
cd /usr/local
ln -s munin-1.3.4/ munin
This on is needed in addition for the server!
pkg-get install pm_htmltemplate
Or use cpan for installation.
cpan> install HTML::Template
Than you need the server cron to run it as user munin every 5 minutes.
crontab -e munin
#minute(0-59) hour(0-23) day(1-31) month(1-12) weekday(0=Sunday-6)
00,05,10,15,20,25,30,35,40,45,50,55 * * * * /opt/csw/munin/bin/munin-cron > /var/adm/munin/cron 2>&1
MAYBE YOU KNOW IT BETTER HERE?
I had some problems with not being able to set up a system /etc/crontab with variable users as common to under Linux.
I had to give user munin a shell and password to have it run the cronjob.
usermod -s/bin/bash -d/tmp munin
passwd munin
BTW: One last thing, if you parse .html as PHP files you need to remove the <?xml … line from the Munin html templates.
for n in `find /opt/csw/munin/etc/templates -type f -name “*.tmpl”`; do echo $n; head -1 $n; sed -i -e ‘//d’ $n; head -1 $n; done
Have some fun!
Best regards, Jan Rasche
Corrections:
PERLLIB = /opt/csw/share/perl/5.8.8/Munin
ln -s /etc/init.d/munin-node /etc/rc3.d/S99munin-node
Congratulations Jan!
I hope I’ll have time and chance to try it.
Thanks for sharing!
Best regards,
L.