CentOS6 で、とにかく Munin を使い始めるための方法をまとめました。http://<ホスト名>/munin/ で対象サーバの上方を閲覧できるようにします。
Munin を EPEL リポジトリで配付されているパッケージを用いてセットアップします。そのために、まずは EPEL リポジトリを有効化します。
# rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm
| #!/bin/sh | |
| while read line | |
| do | |
| echo ${line} | |
| HOSTNAME=`echo ${line} | cut -d ' ' -f 1` | |
| ADDRESS=`echo ${line} | cut -d ' ' -f 2` | |
| case ${SERF_EVENT} in | |
| "member-join") |
| #!/bin/sh | |
| # | |
| # chkconfig: - 89 11 | |
| # description: serf daemon | |
| # processname: serf | |
| # config: /etc/serf.conf | |
| # Default-Start: | |
| # Default-Stop: 0 1 2 3 4 5 6 | |
| # Description: serf agent daemon |
| { | |
| "node_name": "miku3", | |
| "rpc_addr": "192.168.39.11:7373", | |
| "tags": { | |
| "role": "develop", | |
| "network": "local" | |
| }, | |
| "interface": "eth1", | |
| "discover": "mikusan", |
| #!/usr/bin/perl | |
| print "\n### DEBUG:: changetag"; | |
| my $payload = <STDIN>; | |
| print "DEBUG: payload: $payload\n"; | |
| my ($target, $method, $key, $value) = split(/::/, $payload); |
| #!/bin/sh | |
| cp -p /etc/sysconfig/clock /etc/sysconfig/clock.orig | |
| cat <<EOF > /etc/sysconfig/clock | |
| ZONE="Asia/Tokyo" | |
| UTC=false | |
| ARC=false | |
| EOF | |
| mv /etc/localtime /etc/localtime.orig | |
| ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime |
| #!/usr/bin/perl | |
| use Encode; | |
| use Spreadsheet::WriteExcel; | |
| $serf = '/usr/bin/serf'; | |
| my ($sec, $min, $hour, $day, $month, $year, $wday) = localtime; | |
| $year += 1900; |
| #!/usr/bin/perl | |
| # Serf configuration generator with Etcd | |
| # | |
| # MIT License | |
| # 2014 Masahito Zembutsu | |
| use JSON::XS; | |
| use Net::HTTP; | |
| use Data::Dumper; |
| # -*- makefile -*- | |
| # | |
| # This is the Makefile.config file to use for a "clean" distribution. | |
| # | |
| # This file specifies where Munin will look for things after you've | |
| # run 'make' in the source directory. Modify it to suit your needs. | |
| # DESTDIR is meant only for use when making Munin packages. Unless | |
| # you're doing packaging do NOT set it. | |
| # DESTDIR is empty during building, and optionally set to point to |
| #! /bin/sh | |
| # | |
| # munin-node Control the Munin Node Server (formerly Linpro RRD client) | |
| # | |
| # chkconfig: 2345 90 10 | |
| # description: munin node agents | |
| # processname: munin-node | |
| # config: /etc/opt/munin/munin-node.conf | |
| # pidfile: /var/run/munin/munin-node.pid |