Im sick today ans stay at home. And I’m bored.
So, instead of wasting time, I just looking something to do using a lot of my VPS’es. And I remember node monitoring by using Munin. So let’s start the tutorial, and please note that bellow are my VPS specifications :
- Server OS : Ubuntu 10.04 32bit
Memory 256 MB
Burstable 512 MB
Disk Space 15 GB
Bandwidth 1TB
Web Server : Lighttpd + PHP - Node OS : Ubuntu 10.04 32bit
Memory 512 MB
vSwap 512 MB
Disk Space 20 GB
Bandwidth 3TB
Web Server : Lighttpd + PHP + MySQL
Installation for Munin Server Node
-
# apt-get install munin munin-node
- Copying Munin default template to the web dir :
# cp var/cache/munin/www /var/www/munin
- Configuring munin configuration
# nano /etc/munin/munin.conf
# The next three variables specifies where the location of the RRD # databases, the HTML output, and the logs, severally. They all # must be writable by the user running munin-cron. # dbdir /var/lib/munin # htmldir /var/www/munin # logdir /var/log/munin # rundir /var/run/munin # Where to look for the HTML templates tmpldir /etc/munin/templates # Make graphs show values per minute instead of per second #graph_period minute # Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime # something changes (OK -> WARNING, CRITICAL -> OK, etc) #contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm #contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm # # For those with Nagios, the following might come in handy. In addition, # the services must be defined in the Nagios server as well. #contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg # a simple host tree [localhost.localdomain] address 127.0.0.1 use_node_name yes
Change the configuration for example.
# The next three variables specifies where the location of the RRD # databases, the HTML output, and the logs, severally. They all # must be writable by the user running munin-cron. dbdir /var/lib/munin htmldir /var/www/munin logdir /var/log/munin rundir /var/run/munin # Where to look for the HTML templates tmpldir /etc/munin/templates # Make graphs show values per minute instead of per second #graph_period minute # Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime # something changes (OK -> WARNING, CRITICAL -> OK, etc) # contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm # contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm # # For those with Nagios, the following might come in handy. In addition, # the services must be defined in the Nagios server as well. # contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg # a simple host tree [srv.bsie.net] address 127.0.0.1 use_node_name yes # add as many as node you want to monitor, and change the address to your node ip address
- Assign the Munin directory to the Munin user and group by using chown.
# chown munin.munin -R /var/www/munin
- And now you can start Munin.
# /etc/init.d/munin-node start or # service munin-node restart
Installation for Munin Node
-
# apt-get install munin-node
- Configuring the munin-node configuration
# nano /etc/munin/munin.conf
# # Example config-file for munin-node # log_level 4 log_file /var/log/munin/munin-node.log port 4949 pid_file /var/run/munin/munin-node.pid background 1 setseid 1 # Which port to bind to; host * user root group root setsid yes # Regexps for files to ignore ignore_file ~$ ignore_file \.bak$ ignore_file %$ ignore_file \.dpkg-(tmp|new|old|dist)$ ignore_file \.rpm(save|new)$ # Set this if the client doesn't report the correct hostname when # telnetting to localhost, port 4949 # #host_name localhost.localdomain host_name munintest.test.com # A list of addresses that are allowed to connect. This must be a # regular expression, due to brain damage in Net::Server, which # doesn't understand CIDR-style network notation. You may repeat # the allow line as many times as you'd like allow ^127\.0\.0\.1$ allow ^172\.30\.5\.132$
In the above configuration file there are two important things you need to enter.
First one is under
#host_name localhost.localdomain
You need to add your client machine fully qualified name example
#host_name localhost.localdomain host_name hostname.server.com
Second one is you need to enter the server ipaddress by defauly you can see 127.0.0.1 in your config file under that you need to add your munin server ipaddress example as follows
allow ^127\.0\.0\.1$ allow ^172\.30\.5\.132$
And the last, restart both munin in the server and node. Please wait for a moment for munin to update.
You can access the Munin report page from the Server by browse it :
http://ipaddress/munin




