トップ 差分 一覧 ソース 検索 ヘルプ PDF RSS ログイン

munin

[カテゴリ:Linux]

概要

システムリソースをグラフ化するツール
ブラウザから状況を参照できる。
メインモジュール(cronで定周期起動) と nodeモジュール(監視対象マシン上で起動) がありTCPで通信する。

  • インストールはHotSaNICより簡単。
  • プラグインも比較的簡単に作れそう。
  • プラグインの正体は、テキストで情報を吐き出すスクリプトなので、言語問わず作れるらしい。

複数サーバのリソースを扱うこともできるっぽいが、今回は1マシンでやってみた。

参考

BUKURO-JIN | リソース監視奮闘記 〜ねぇ Munin〜:
http://blog.y-110.net/log/eid96.html

気まぐれSE日記:
http://d.hatena.ne.jp/tak_yah/searchdiary?word=%2a%5bMunin%5d

GIGAZINE - Muninをカスタマイズして表示されるグラフの種類を増やしてみる:
http://gigazine.net/index.php?/news/20070120_munin_config/

debian sarge へ インストール

apt-get install

goun@prius:~$ apt-cache show munin munin-node
Package: munin
Priority: optional
Section: net
Installed-Size: 516
Maintainer: Munin Debian Maintainers <munin-deb-maint@linpro.no>
Architecture: all
Version: 1.2.3-1
Depends: perl (>= 5.6.0-16), perl-modules (>= 5.8.0) | libparse-recdescent-perl, librrds-perl, libhtml-template-perl, libdigest-md5-perl, libtime-hires-perl, libstorable-perl
Recommends: munin-node, libdate-manip-perl
Suggests: rrdtool, www-browser, httpd
Conflicts: lrrd-server (<= 0.9.9r5-1)
Filename: pool/main/m/munin/munin_1.2.3-1_all.deb
Size: 144512
MD5sum: 905dcb2966e0631af4c0ecd238b55a44
SHA1: b755141436e34f9480efa4a519bbe9230103e354
SHA256: 4328c21f559fffdd66e58b9365162d200e177ef446c58fdca320f0ab4d33a981
Description: network-wide graphing framework (grapher/gatherer)
 Munin is a highly flexible and powerful solution used to create graphs of
 virtually everything imaginable throughout your network, while still
 maintaining a rattling ease of installation and configuration.
 .
 This package contains the grapher/gatherer. You will only need one instance of
 it in your network. It will periodically poll all the nodes in your network
 it's aware of for data, which it in turn will use to create graphs and HTML
 pages, suitable for viewing with your graphical web browser of choice.
 .
 It is also able to alert you if any value is outside of a preset boundary,
 useful if you want to be alerted if a filesystem is about to grow full, for
 instance.  You can do this by making Munin run an arbitrary command when you
 need to be alert it, or make use of the intrinsic Nagios support.
 .
 Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent
 RRDtool. To see a real example of Munin in action, take a peek at
 <http://www.linpro.no/projects/munin/example/>.

Package: munin-node
Priority: optional
Section: net
Installed-Size: 876
Maintainer: Munin Debian Maintainers <munin-deb-maint@linpro.no>
Architecture: all
Source: munin
Version: 1.2.3-1
Depends: perl, libnet-server-perl, procps
Recommends: libnet-snmp-perl
Suggests: munin, libwww-perl, libnet-irc-perl, mysql-client, smartmontools, acpi | lm-sensors, python (>= 2.2)
Conflicts: lrrd-client (<= 0.9.9r5-1)
Filename: pool/main/m/munin/munin-node_1.2.3-1_all.deb
Size: 182316
MD5sum: cd9e18a7de98e82812f672d96126cf5e
SHA1: 9489bece3f66ea12a119415027f365f3849ce567
SHA256: f40400b4bb180370b44a582d0fa45f44b6801281ecc14fab75c949fd478fa2d7
Description: network-wide graphing framework (node)
 Munin is a highly flexible and powerful solution used to create graphs of
 virtually everything imaginable throughout your network, while still
 maintaining a rattling ease of installation and configuration.
 .
 This package contains the daemon for the nodes being monitored.  You should
 install it on all the nodes in your network. It will know how to extract all
 sorts of data from the node it runs on, and will wait for the gatherer to
 request this data for further processing.
 .
 It includes a range of plugins capable of extracting common values such as cpu
 usage, network usage, load average, and so on. Creating your own plugins which
 are capable of extracting other system-specific values is very easy, and is
 often done in a matter of minutes. You can also create plugins which relay
 information from other devices in your network that can't run Munin, such as a
 switch or a server running another operating system, by using SNMP or similar
 technology.
 .
 Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent
 RRDtool. To see a real example of Munin in action, take a peek at
 <http://www.linpro.no/projects/munin/example/>.
goun@prius:~$ sudo apt-get install munin munin-node
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  libhtml-template-perl libio-multiplex-perl libnet-server-perl
提案パッケージ:
  libipc-sharedcache-perl libio-socket-ssl-perl libwww-perl libnet-irc-perl
  acpi
推奨パッケージ:
  libdate-manip-perl libnet-snmp-perl
以下のパッケージが新たにインストールされます:
  libhtml-template-perl libio-multiplex-perl libnet-server-perl munin
  munin-node
アップグレード: 0 個、新規インストール: 5 個、削除: 0 個、保留: 30 個。
538kB のアーカイブを取得する必要があります。
展開後に追加で 2175kB のディスク容量が消費されます。
続行しますか? [Y/n] Y
取得:1 ftp://ftp.jp.debian.org sarge/main libhtml-template-perl 2.6-2 [62.4kB]
取得:2 ftp://ftp.jp.debian.org sarge/main libio-multiplex-perl 1.08-1 [21.9kB]
取得:3 ftp://ftp.jp.debian.org sarge/main libnet-server-perl 0.87-3sarge1 [127kB]
取得:4 ftp://ftp.jp.debian.org sarge/main munin 1.2.3-1 [145kB]
取得:5 ftp://ftp.jp.debian.org sarge/main munin-node 1.2.3-1 [182kB]
538kB を 2s で取得しました (254kB/s)
未選択パッケージ libhtml-template-perl を選択しています。
(データベースを読み込んでいます... 現在 26319 個のファイルとディレクトリがインストールされています。)
(.../libhtml-template-perl_2.6-2_all.deb から) libhtml-template-perl を展開しています...
未選択パッケージ libio-multiplex-perl を選択しています。
(.../libio-multiplex-perl_1.08-1_all.deb から) libio-multiplex-perl を展開しています...
未選択パッケージ libnet-server-perl を選択しています。
(.../libnet-server-perl_0.87-3sarge1_all.deb から) libnet-server-perl を展開しています...
未選択パッケージ munin を選択しています。
(.../archives/munin_1.2.3-1_all.deb から) munin を展開しています...
未選択パッケージ munin-node を選択しています。
(.../munin-node_1.2.3-1_all.deb から) munin-node を展開しています...
libhtml-template-perl (2.6-2) を設定しています ...
libio-multiplex-perl (1.08-1) を設定しています ...
libnet-server-perl (0.87-3sarge1) を設定しています ...
munin (1.2.3-1) を設定しています ...
システムユーザ munin を追加しています...
Adding new group `munin' (108).
Adding new user `munin' (108) with group `munin'.
ホームディレクトリは作成しません。

munin-node (1.2.3-1) を設定しています ...
Initializing plugins..done.
Starting munin-node: done.

goun@prius:~$

dpkg -L

goun@prius:~$ dpkg -L munin
/.
/var
/var/www
/var/www/munin
/var/lib
/var/lib/munin
/var/log
/var/log/munin
/var/run
/var/run/munin
/etc
/etc/munin
/etc/munin/templates
/etc/munin/templates/munin-comparison-day.tmpl
/etc/munin/templates/munin-comparison-month.tmpl
/etc/munin/templates/munin-comparison-week.tmpl
/etc/munin/templates/munin-comparison-year.tmpl
/etc/munin/templates/munin-domainview.tmpl
/etc/munin/templates/munin-nodeview.tmpl
/etc/munin/templates/munin-overview.tmpl
/etc/munin/templates/munin-serviceview.tmpl
/etc/munin/templates/logo.png
/etc/munin/templates/style.css
/etc/munin/templates/definitions.html
/etc/munin/munin.conf
/etc/cron.d
/etc/cron.d/munin
/etc/logrotate.d
/etc/logrotate.d/munin
/usr
/usr/share
/usr/share/munin
/usr/share/munin/munin-update
/usr/share/munin/munin-graph
/usr/share/munin/munin-html
/usr/share/munin/munin-limits
/usr/share/perl5
/usr/share/perl5/Munin.pm
/usr/share/doc
/usr/share/doc/munin
/usr/share/doc/munin/munin-faq.html
/usr/share/doc/munin/munin-faq.txt.gz
/usr/share/doc/munin/munin-doc.pdf.gz
/usr/share/doc/munin/munin-doc.html
/usr/share/doc/munin/munin-doc.txt.gz
/usr/share/doc/munin/NEWS.Debian.gz
/usr/share/doc/munin/README-apache-cgi
/usr/share/doc/munin/copyright
/usr/share/doc/munin/changelog.gz
/usr/share/doc/munin/munin-faq.pdf.gz
/usr/share/doc/munin/changelog.Debian.gz
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/munin-html.8.gz
/usr/share/man/man8/munin-limits.8.gz
/usr/share/man/man8/munin-update.8.gz
/usr/share/man/man8/munin-cron.8.gz
/usr/share/man/man8/munin-graph.8.gz
/usr/share/man/man5
/usr/share/man/man5/munin.conf.5.gz
/usr/bin
/usr/bin/munin-cron
/usr/lib
/usr/lib/cgi-bin
/usr/lib/cgi-bin/munin-cgi-graph
goun@prius:~$ dpkg -L munin-node
/.
/etc
/etc/munin
/etc/munin/plugins
/etc/munin/plugin-conf.d
/etc/munin/plugin-conf.d/munin-node
/etc/munin/munin-node.conf
/etc/init.d
/etc/init.d/munin-node
/etc/cron.d
/etc/cron.d/munin-node
/etc/logrotate.d
/etc/logrotate.d/munin-node
/usr
/usr/share
/usr/share/munin
/usr/share/munin/plugins
/usr/share/munin/plugins/apt
/usr/share/munin/plugins/apt_all
/usr/share/munin/plugins/cps_
/usr/share/munin/plugins/cpu
/usr/share/munin/plugins/df
/usr/share/munin/plugins/df_abs
/usr/share/munin/plugins/df_inode
/usr/share/munin/plugins/entropy
/usr/share/munin/plugins/forks
/usr/share/munin/plugins/fw_conntrack
/usr/share/munin/plugins/fw_forwarded_local
/usr/share/munin/plugins/fw_packets
/usr/share/munin/plugins/if_
/usr/share/munin/plugins/if_err_
/usr/share/munin/plugins/interrupts
/usr/share/munin/plugins/iostat
/usr/share/munin/plugins/ip_
/usr/share/munin/plugins/irqstats
/usr/share/munin/plugins/load
/usr/share/munin/plugins/memory
/usr/share/munin/plugins/netstat
/usr/share/munin/plugins/nfs_client
/usr/share/munin/plugins/nfsd
/usr/share/munin/plugins/open_files
/usr/share/munin/plugins/open_inodes
/usr/share/munin/plugins/port_
/usr/share/munin/plugins/processes
/usr/share/munin/plugins/sensors_
/usr/share/munin/plugins/swap
/usr/share/munin/plugins/uptime
/usr/share/munin/plugins/vlan_
/usr/share/munin/plugins/vlan_inetuse_
/usr/share/munin/plugins/vlan_linkuse_
/usr/share/munin/plugins/acpi
/usr/share/munin/plugins/apache_accesses
/usr/share/munin/plugins/apache_processes
/usr/share/munin/plugins/apache_volume
/usr/share/munin/plugins/courier_mta_mailqueue
/usr/share/munin/plugins/courier_mta_mailstats
/usr/share/munin/plugins/courier_mta_mailvolume
/usr/share/munin/plugins/cupsys_pages
/usr/share/munin/plugins/exim_mailqueue
/usr/share/munin/plugins/exim_mailstats
/usr/share/munin/plugins/hddtemp_smartctl
/usr/share/munin/plugins/ircu
/usr/share/munin/plugins/loggrep
/usr/share/munin/plugins/multips
/usr/share/munin/plugins/munin_graph
/usr/share/munin/plugins/munin_update
/usr/share/munin/plugins/mysql_bytes
/usr/share/munin/plugins/mysql_isam_space_
/usr/share/munin/plugins/mysql_queries
/usr/share/munin/plugins/mysql_slowqueries
/usr/share/munin/plugins/mysql_threads
/usr/share/munin/plugins/ntp_
/usr/share/munin/plugins/ntp_states
/usr/share/munin/plugins/ping_
/usr/share/munin/plugins/postfix_mailqueue
/usr/share/munin/plugins/postfix_mailstats
/usr/share/munin/plugins/postfix_mailvolume
/usr/share/munin/plugins/ps_
/usr/share/munin/plugins/psu_
/usr/share/munin/plugins/sendmail_mailqueue
/usr/share/munin/plugins/sendmail_mailstats
/usr/share/munin/plugins/sendmail_mailtraffic
/usr/share/munin/plugins/smart_
/usr/share/munin/plugins/snmp__df
/usr/share/munin/plugins/snmp__fc_if_
/usr/share/munin/plugins/snmp__fc_if_err_
/usr/share/munin/plugins/snmp__if_
/usr/share/munin/plugins/snmp__if_err_
/usr/share/munin/plugins/snmp__load
/usr/share/munin/plugins/snmp__processes
/usr/share/munin/plugins/snmp__sensors_fsc_bx_fan
/usr/share/munin/plugins/snmp__sensors_fsc_bx_temp
/usr/share/munin/plugins/snmp__sensors_fsc_fan
/usr/share/munin/plugins/snmp__sensors_fsc_temp
/usr/share/munin/plugins/snmp__sensors_mbm_fan
/usr/share/munin/plugins/snmp__sensors_mbm_temp
/usr/share/munin/plugins/snmp__sensors_mbm_volt
/usr/share/munin/plugins/snmp__users
/usr/share/munin/plugins/squid_cache
/usr/share/munin/plugins/squid_icp
/usr/share/munin/plugins/squid_requests
/usr/share/munin/plugins/squid_traffic
/usr/share/munin/plugins/sybase_space
/usr/share/munin/plugins/vmstat
/usr/share/munin/plugins/plugins.history
/usr/share/perl5
/usr/share/perl5/Munin
/usr/share/perl5/Munin/Plugin
/usr/share/doc
/usr/share/doc/munin-node
/usr/share/doc/munin-node/munin-faq.html
/usr/share/doc/munin-node/munin-faq.txt.gz
/usr/share/doc/munin-node/munin-doc.pdf.gz
/usr/share/doc/munin-node/munin-doc.html
/usr/share/doc/munin-node/munin-doc.txt.gz
/usr/share/doc/munin-node/NEWS.Debian.gz
/usr/share/doc/munin-node/README.Debian
/usr/share/doc/munin-node/copyright
/usr/share/doc/munin-node/changelog.gz
/usr/share/doc/munin-node/munin-faq.pdf.gz
/usr/share/doc/munin-node/changelog.Debian.gz
/usr/share/man
/usr/share/man/man5
/usr/share/man/man5/munin-node.conf.5.gz
/usr/share/man/man8
/usr/share/man/man8/munin-node-configure-snmp.8.gz
/usr/share/man/man8/munin-run.8.gz
/usr/share/man/man8/munin-node.8.gz
/usr/share/man/man8/munin-node-configure.8.gz
/usr/sbin
/usr/sbin/munin-node
/usr/sbin/munin-node-configure
/usr/sbin/munin-run
/usr/sbin/munin-node-configure-snmp
/var
/var/log
/var/log/munin
/var/run
/var/run/munin
/var/lib
/var/lib/munin
/var/lib/munin/plugin-state

ブラウザからアクセス

http://goun.dip.jp/munin/

丸見えなので必要であればApacheでアクセス制限必要だな。

さぐってみる

nodeがデーモンで動いてる。

goun@prius:~$ ps -ef | grep munin
root     14478     1  0 01:07 ?        00:00:00 /usr/sbin/munin-node
goun     15896 13967  0 01:24 pts/0    00:00:00 grep munin

TCP使ってる

goun@prius:~$ netstat -a | grep munin
tcp        0      0 *:munin                 *:*                     LISTEN

ポート番号は。

goun@prius:~$ grep munin /etc/services
munin           4949/tcp        lrrd            # Munin

5分周期で動いてる

goun@prius:~$ cat /etc/cron.d/munin
#
# cron-jobs for munin
#

MAILTO=root

*/5 * * * *     munin if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi
10 10 * * *     munin if [ -x /usr/share/munin/munin-limits ]; then /usr/share/munin/munin-limits --force --contact nagios --contact old-nagios; fi

apache_* プラグインが動いてない?

生成されたグラフにApache関連のものがないので調査してみる。

以下がリンクでアクティブ化されている。

  • /usr/share/munin/plugins/*:提供されているプラグイン群
  • /etc/munin/plugins/*:アクティブなプラグイン群

apache_volumeがなぜ動かないのかチェックしてみる。

goun@prius:/usr/share/munin/plugins$ /usr/sbin/munin-run --servicedir /usr/share/munin/plugins apache_volume autoconf
no (no apache server-status or ExtendedStatus missing on ports 80)
goun@prius:/usr/share/munin/plugins$

Apacheのserver-statusにアクセスできていないようだ。

設定してみる。

goun@prius:~$ sudo vi /etc/munin/plugin-conf.d/munin-node
:
[apache_*]
env.url http://localhost/local/server-status

再チェック

goun@prius:~$ /usr/sbin/munin-run --servicedir /usr/share/munin/plugins apache_volume autoconf
no (no apache server-status or ExtendedStatus missing on ports 80)

だめだ・・・
デバッグモードでチェックしてみる。

goun@prius:~$ /usr/sbin/munin-run --servicedir /usr/share/munin/plugins --debug apache_volume autoconf
Saving mysql*->env->mysqlopts = --defaults-extra-file=/etc/mysql/debian.cnf...
Saving apache_*->env->url = http://localhost/local/server-status...
# file: 'apache_volume'
Checking apache_*...
Checking apache_*...
Checking apache_*...
Checking apache_*...
Saving apache_*->url
Setting environment url=http://localhost/local/server-status
DEBUG: About to exec "/usr/share/munin/plugins/apache_volume".no (no apache server-status or ExtendedStatus missing on ports 80)
goun@prius:~$

なんでだろ。。
プラグイン本体を見てみる

goun@prius:~$ vi /usr/share/munin/plugins/apache_volume

あ〜
設定変更

goun@prius:~$ sudo vi /etc/munin/plugin-conf.d/munin-node
:
[apache_*]
env.url http://localhost/local/server-status?auto

再々チェック

goun@prius:~$ /usr/sbin/munin-run --servicedir /usr/share/munin/plugins --debug apache_volume autoconf
Saving mysql*->env->mysqlopts = --defaults-extra-file=/etc/mysql/debian.cnf...
Saving apache_*->env->url = http://localhost/local/server-status?auto...
# file: 'apache_volume'
Checking apache_*...
Checking apache_*...
Checking apache_*...
Checking apache_*...
Saving apache_*->url
Setting environment url=http://localhost/local/server-status?auto
DEBUG: About to exec "/usr/share/munin/plugins/apache_volume".yes

おっけー

プラグインをアクティブ化するため、リンクする。

goun@prius:~$ sudo ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/apache_volume
goun@prius:~$ sudo ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/apache_accesses
goun@prius:~$ sudo ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes
goun@prius:~$
goun@prius:~$ ls -al /etc/munin/plugins/apache_*
lrwxrwxrwx  1 root root 40 2007-02-19 02:34 /etc/munin/plugins/apache_accesses -> /usr/share/munin/plugins/apache_accesses
lrwxrwxrwx  1 root root 41 2007-02-19 02:34 /etc/munin/plugins/apache_processes -> /usr/share/munin/plugins/apache_processes
lrwxrwxrwx  1 root root 38 2007-02-19 02:33 /etc/munin/plugins/apache_volume -> /usr/share/munin/plugins/apache_volume

node再起動

goun@prius:~$ sudo /etc/init.d/munin-node
Usage: /etc/init.d/munin-node {start|stop|restart|force-reload}
goun@prius:~$ sudo /etc/init.d/munin-node restart
Stopping munin-node: done.
Starting munin-node: done.

監視周期が5分なので待つ。。。

グラフ化されていればおっけー

redhat9 へ インストール

rrdtool-1.0.50-3.rh9.rf.i386.rpm インストール

まず先にrrdtoolをインストール

[goun@www src]$ wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.0.50-3.rh9.rf.i386.rpm
--17:17:19--  http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.0.50-3.rh9.rf.i386.rpm
           => `rrdtool-1.0.50-3.rh9.rf.i386.rpm'
dag.wieers.com をDNSに問いあわせています... 完了しました。
dag.wieers.com[217.22.63.77]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: http://apt.sw.be/packages/rrdtool/rrdtool-1.0.50-3.rh9.rf.i386.rpm [続く]
--17:17:20--  http://apt.sw.be/packages/rrdtool/rrdtool-1.0.50-3.rh9.rf.i386.rpm
           => `rrdtool-1.0.50-3.rh9.rf.i386.rpm'
apt.sw.be をDNSに問いあわせています... 完了しました。
apt.sw.be[193.1.193.67]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 443,391 [application/x-redhat-package-manager]

100%[====================================>] 443,391       25.54K/s    ETA 00:00

17:17:45 (25.54 KB/s) - `rrdtool-1.0.50-3.rh9.rf.i386.rpm' を保存しました [443391/443391]

[goun@www src]$
[goun@www src]$ rpm -ivh --test rrdtool-1.0.50-3.rh9.rf.i386.rpm
警告: rrdtool-1.0.50-3.rh9.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
[goun@www src]$
[goun@www src]$ sudo rpm -ivh rrdtool-1.0.50-3.rh9.rf.i386.rpm
Password:
警告: rrdtool-1.0.50-3.rh9.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:rrdtool                ########################################### [100%]
[goun@www src]$

munin_1.2.5.tar.gz インストール

ダウンロード&解凍

[goun@www src]$ wget http://nchc.dl.sourceforge.net/sourceforge/munin/munin_1.2.5.tar.gz
--16:38:54--  http://nchc.dl.sourceforge.net/sourceforge/munin/munin_1.2.5.tar.gz
           => `munin_1.2.5.tar.gz'
nchc.dl.sourceforge.net をDNSに問いあわせています... 完了しました。
nchc.dl.sourceforge.net[211.79.61.10]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 353,005 [application/x-gzip]

100%[====================================>] 353,005      805.45K/s    ETA 00:00

16:38:55 (805.45 KB/s) - `munin_1.2.5.tar.gz' を保存しました [353005/353005]

[goun@www src]$ tar zxf munin_1.2.5.tar.gz

グループ&ユーザ作成

[goun@www munin-1.2.5]$ sudo /usr/sbin/groupadd -g 4949 munin
[goun@www munin-1.2.5]$ sudo /usr/sbin/useradd -u 4949 -g munin -M -s /sbin/nologin munin
[goun@www munin-1.2.5]$

メインモジュール インストール

[goun@www munin-1.2.5]$ make install-main
Generating ./node/node.d.freebsd/vmstat..
Generating ./node/node.d.freebsd/swap..
Generating ./node/node.d.freebsd/if_..
Generating ./node/node.d.freebsd/if_errcoll_..
Generating ./node/node.d.freebsd/load..
Generating ./node/node.d.freebsd/netstat..
Generating ./node/node.d.freebsd/open_files..
Generating ./node/node.d.freebsd/processes..
Generating ./node/node.d.freebsd/cpu..
Generating ./node/node.d.freebsd/df_inode..
Generating ./node/node.d.freebsd/memory..
Generating ./node/node.d.freebsd/df..
Generating ./node/node.d.aix/netstat..
Generating ./node/node.d.aix/swap..
Generating ./node/node.d.aix/iostat.hd_only..
Generating ./node/node.d.aix/iostat..
Generating ./node/node.d.aix/processes..
Generating ./node/node.d.aix/cpu..
Generating ./node/node.d.aix/iostat.vp_only..
Generating ./node/node.d.aix/memory..
Generating ./node/node.d.aix/df..
Generating ./node/munin-node-configure..
Generating ./node/plugins.history..
Generating ./node/SNMP.pm..
Generating ./node/node.d.linux/iostat_ios..
Generating ./node/node.d.linux/irqstats..
Generating ./node/node.d.linux/swap..
Generating ./node/node.d.linux/apt_all..
Generating ./node/node.d.linux/interrupts..
Generating ./node/node.d.linux/df_abs..
Generating ./node/node.d.linux/nfs_client..
Generating ./node/node.d.linux/apt..
Generating ./node/node.d.linux/fw_packets..
Generating ./node/node.d.linux/vlan_linkuse_..
Generating ./node/node.d.linux/nfsd..
Generating ./node/node.d.linux/vlan_inetuse_..
Generating ./node/node.d.linux/if_..
Generating ./node/node.d.linux/entropy..
Generating ./node/node.d.linux/iostat..
Generating ./node/node.d.linux/if_err_..
Generating ./node/node.d.linux/ip_..
Generating ./node/node.d.linux/memory..
Generating ./node/node.d.linux/i2c..
Generating ./node/node.d.linux/fw_conntrack..
Generating ./node/node.d.linux/load..
Generating ./node/node.d.linux/netstat..
Generating ./node/node.d.linux/open_files..
Generating ./node/node.d.linux/fw_forwarded_local..
Generating ./node/node.d.linux/port_..
Generating ./node/node.d.linux/forks..
Generating ./node/node.d.linux/cps_..
Generating ./node/node.d.linux/cpu..
Generating ./node/node.d.linux/df..
Generating ./node/node.d.linux/sensors_..
Generating ./node/node.d.linux/netopia..
Generating ./node/node.d.linux/vlan_..
Generating ./node/node.d.linux/files_..
Generating ./node/node.d.linux/i2c_fan..
Generating ./node/node.d.linux/users..
Generating ./node/node.d.linux/open_inodes..
Generating ./node/node.d.linux/uptime..
Generating ./node/node.d.linux/processes..
Generating ./node/node.d.linux/df_inode..
Generating ./node/munin-run..
Generating ./node/node.d/exim_mailstats..
Generating ./node/node.d/mysql_bytes..
Generating ./node/node.d/foldingathome..
Generating ./node/node.d/ps_..
Generating ./node/node.d/squid_traffic..
Generating ./node/node.d/mhttping..
Generating ./node/node.d/samba..
Generating ./node/node.d/courier_mta_mailvolume..
Generating ./node/node.d/foldingathome_rank..
Generating ./node/node.d/multips..
Generating ./node/node.d/sendmail_mailtraffic..
Generating ./node/node.d/snmp__processes..
Generating ./node/node.d/mbmon_..
Generating ./node/node.d/bind9..
Generating ./node/node.d/postfix_mailstats..
Generating ./node/node.d/cupsys_pages..
Generating ./node/node.d/apc_envunit_..
Generating ./node/node.d/pop_stats..
Generating ./node/node.d/apache_processes..
Generating ./node/node.d/mysql_threads..
Generating ./node/node.d/spamstats..
Generating ./node/node.d/pm3users_..
Generating ./node/node.d/amavis..
Generating ./node/node.d/df..
Generating ./node/node.d/courier_mta_mailqueue..
Generating ./node/node.d/ntp_states..
Generating ./node/node.d/smart_..
Generating ./node/node.d/hddtemp..
Generating ./node/node.d/snmp__sensors_mbm_volt..
Generating ./node/node.d/postfix_mailvolume..
Generating ./node/node.d/surfboard..
Generating ./node/node.d/snmp__if_..
Generating ./node/node.d/nut_volts..
Generating ./node/node.d/perdition..
Generating ./node/node.d/loggrep..
Generating ./node/node.d/snmp__fc_if_..
Generating ./node/node.d/ircu..
Generating ./node/node.d/mysql_queries..
Generating ./node/node.d/dhcpd3..
Generating ./node/node.d/df_inode..
Generating ./node/node.d/acpi..
Generating ./node/node.d/snmp__sensors_fsc_fan..
Generating ./node/node.d/exim_mailqueue_alt..
Generating ./node/node.d/mysql_slowqueries..
Generating ./node/node.d/squid_cache..
Generating ./node/node.d/apache_volume..
Generating ./node/node.d/named..
Generating ./node/node.d/snmp__sensors_fsc_temp..
Generating ./node/node.d/sendmail_mailstats..
Generating ./node/node.d/exim_mailqueue..
Generating ./node/node.d/snmp__load..
Generating ./node/node.d/munin_update..
Generating ./node/node.d/ipac-ng..
Generating ./node/node.d/squid_icp..
Generating ./node/node.d/squid_requests..
Generating ./node/node.d/nut_misc..
Generating ./node/node.d/snmp__df..
Generating ./node/node.d/snmp__sensors_mbm_fan..
Generating ./node/node.d/mysql_isam_space_..
Generating ./node/node.d/hddtempd..
Generating ./node/node.d/apache_accesses..
Generating ./node/node.d/ping_..
Generating ./node/node.d/snmp__users..
Generating ./node/node.d/hddtemp_smartctl..
Generating ./node/node.d/sybase_space..
Generating ./node/node.d/psu_..
Generating ./node/node.d/snmp__sensors_fsc_bx_fan..
Generating ./node/node.d/postfix_mailqueue..
Generating ./node/node.d/munin_graph..
Generating ./node/node.d/courier_..
Generating ./node/node.d/hddtemp2..
Generating ./node/node.d/snmp__sensors_mbm_temp..
Generating ./node/node.d/bind9_rndc..
Generating ./node/node.d/apc_nis..
Generating ./node/node.d/mailman..
Generating ./node/node.d/vmstat..
Generating ./node/node.d/ntp_..
Generating ./node/node.d/courier_mta_mailstats..
Generating ./node/node.d/foldingathome_wu..
Generating ./node/node.d/mailscanner..
Generating ./node/node.d/snmp__fc_if_err_..
Generating ./node/node.d/snmp__if_err_..
Generating ./node/node.d/snmp__sensors_fsc_bx_temp..
Generating ./node/node.d/sendmail_mailqueue..
Generating ./node/munin-node.conf..
Generating ./node/node.d.sunos/if_errcoll_..
Generating ./node/node.d.sunos/io_bytes_..
Generating ./node/node.d.sunos/netstat..
Generating ./node/node.d.sunos/load..
Generating ./node/node.d.sunos/fs_df..
Generating ./node/node.d.sunos/io_ops_..
Generating ./node/node.d.sunos/cpu..
Generating ./node/node.d.sunos/paging_out..
Generating ./node/node.d.sunos/paging_in..
Generating ./node/node.d.sunos/processes..
Generating ./node/node.d.sunos/if_..
Generating ./node/node.d.sunos/temperature..
Generating ./node/node.d.sunos/io_busy_..
Generating ./node/node.d.sunos/memory..
Generating ./node/node.d.sunos/fs_inodes..
Generating ./node/munin-node-simple..
Generating ./node/munin-node-configure-snmp..
Generating ./node/munin-node..
Generating ./README-apache-cgi..
Generating ./dists/suse/munin.spec..
Generating ./dists/redhat/munin.spec..
Generating ./dists/freebsd/munin-main/files/patch-munin-limits..
Generating ./dists/freebsd/munin-main/files/pkg-message..
Generating ./dists/freebsd/munin-node/files/patch-munin-node.conf..
Generating ./dists/freebsd/munin-node/files/munin-node-revive.sh..
Generating ./dists/freebsd/munin-node/files/munin-node.sh..
Generating ./dists/freebsd/munin-node/files/pkg-message..
Generating ./server/munin-cgi-graph..
Generating ./server/munin.conf..
Generating ./server/munin-nodeview.tmpl..
Generating ./server/munin-comparison-month.tmpl..
Generating ./server/munin-comparison-day.tmpl..
Generating ./server/munin-cron..
Generating ./server/munin-graph..
Generating ./server/munin-limits..
Generating ./server/munin-html..
Generating ./server/munin-serviceview.tmpl..
Generating ./server/munin-domainview.tmpl..
Generating ./server/Munin.pm..
Generating ./server/munin-overview.tmpl..
Generating ./server/munin-comparison-week.tmpl..
Generating ./server/munin-update..
Generating ./server/munin-comparison-year.tmpl..
touch build-stamp
mkdir -p /etc/opt/munin/templates
mkdir: ディレクトリ `/etc/opt/munin' を作成できません: 許可がありません
make: *** [install-main] エラー 1
[goun@www munin-1.2.5]$
[goun@www munin-1.2.5]$ sudo make install-main
mkdir -p /etc/opt/munin/templates
mkdir -p /opt/munin/lib
mkdir -p /opt/munin/bin
mkdir -p /usr/lib/perl5/site_perl/5.8.0
mkdir -p /var/log/munin
mkdir -p /var/run/munin
mkdir -p /opt/munin/var/www
mkdir -p /var/opt/munin
mkdir -p /opt/munin/var/www/cgi
chown munin /var/log/munin /var/run/munin  /opt/munin/var/www /var/opt/munin
for p in build/server/*.tmpl; do                              \
        ./install-sh -m 0644 "$p" /etc/opt/munin/templates/ ; \
done
./install-sh -m 0644 server/logo.png /etc/opt/munin/templates/
./install-sh -m 0644 server/style.css /etc/opt/munin/templates/
./install-sh -m 0644 server/definitions.html /etc/opt/munin/templates/
./install-sh -m 0755 server/VeraMono.ttf /opt/munin/lib/
test -f "/etc/opt/munin/munin.conf"  || ./install-sh -m 0644 build/server/munin.conf /etc/opt/munin/
./install-sh -m 0755 build/server/munin-cron /opt/munin/bin/
./install-sh -m 0755 build/server/munin-update /opt/munin/lib/
./install-sh -m 0755 build/server/munin-graph /opt/munin/lib/
./install-sh -m 0755 build/server/munin-html /opt/munin/lib/
./install-sh -m 0755 build/server/munin-limits /opt/munin/lib/
./install-sh -m 0755 build/server/munin-cgi-graph /opt/munin/var/www/cgi/
./install-sh -m 0644 build/server/Munin.pm /usr/lib/perl5/site_perl/5.8.0/
[goun@www munin-1.2.5]$

munin-node インストール

[goun@www munin-1.2.5]$ sudo make install-node install-node-plugins
mkdir -p /etc/opt/munin/plugins
mkdir -p /etc/opt/munin/plugin-conf.d
mkdir -p /opt/munin/lib/plugins
mkdir -p /opt/munin/sbin
mkdir -p /usr/lib/perl5/site_perl/5.8.0/Munin/Plugin
mkdir -p /var/log/munin
mkdir -p /var/run/munin
mkdir -p /var/opt/munin/plugin-state
chgrp munin /var/opt/munin/plugin-state
chmod 775 /var/opt/munin/plugin-state
chmod 755 /etc/opt/munin/plugin-conf.d
./install-sh -m 0755 build/node/munin-node /opt/munin/sbin/
./install-sh -m 0755 build/node/munin-node-configure /opt/munin/sbin/
test -f "/etc/opt/munin/munin-node.conf" || ./install-sh -m 0644 build/node/munin-node.conf /etc/opt/munin/
./install-sh -m 0755 build/node/munin-run /opt/munin/sbin/
./install-sh -m 0755 build/node/munin-node-configure-snmp /opt/munin/sbin/
echo Done.
Done.
for p in build/node/node.d.linux/* build/node/node.d/*; do              \
        if test -f "$p" ; then                                                 \
                family=`sed -n 's/^#%# family=\(.*\)$/\1/p' $p`;               \
                test "$family" || family=contrib;                              \
                if echo "auto manual contrib snmpauto" | grep $family >/dev/null; then  \
                        test -f "/opt/munin/lib/plugins/`basename $p`"         \
                        || ./install-sh -m 0755 $p /opt/munin/lib/plugins/;    \
                fi;                                                            \
        fi                                                                     \
done
./install-sh -m 0644 build/node/plugins.history /opt/munin/lib/plugins/
#TODO:
#configure plugins.
[goun@www munin-1.2.5]$

設定&動作確認

メインモジュールを動かしてみる。

[goun@www munin-1.2.5]$ sudo /opt/munin/bin/munin-cron
Can't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thr
ead-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-
multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/ven
dor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib
/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5
.8.0 .) at /usr/lib/perl5/site_perl/5.8.0/Munin.pm line 267.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.0/Munin.pm lin
e 267.
Compilation failed in require at /opt/munin/lib/munin-update line 168.
BEGIN failed--compilation aborted at /opt/munin/lib/munin-update line 168.
Can't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thr
ead-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-
multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/ven
dor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib
/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5
.8.0 .) at /usr/lib/perl5/site_perl/5.8.0/Munin.pm line 267.
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.0/Munin.pm lin
e 267.
Compilation failed in require at /opt/munin/lib/munin-limits line 118.
BEGIN failed--compilation aborted at /opt/munin/lib/munin-limits line 118.
Can't locate RRDs.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thr
ead-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-
multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/ven
dor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib
/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5
.8.0 .) at /opt/munin/lib/munin-graph line 26.
BEGIN failed--compilation aborted at /opt/munin/lib/munin-graph line 26.
Can't locate HTML/Template.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-
linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linu
x-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/
perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0
 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/li
b/perl5/5.8.0 .) at /opt/munin/lib/munin-html line 180.
BEGIN failed--compilation aborted at /opt/munin/lib/munin-html line 180.
[goun@www munin-1.2.5]$

Can't locate RRDs.pm in @INC
Can't locate HTML/Template.pm in @INC
とのことなので、

perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm インストール

[goun@www src]$ wget http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm
--17:40:08--  http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm
           => `perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm'
dag.wieers.com をDNSに問いあわせています... 完了しました。
dag.wieers.com[217.22.63.77]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: http://apt.sw.be/packages/rrdtool/perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm [続く]
--17:40:08--  http://apt.sw.be/packages/rrdtool/perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm
           => `perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm'
apt.sw.be をDNSに問いあわせています... 完了しました。
apt.sw.be[193.1.193.67]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 140,820 [application/x-redhat-package-manager]

100%[==========================================================>] 140,820       29.27K/s    ETA 00:00

17:40:14 (29.27 KB/s) - `perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm' を保存しました [140820/140820]

[goun@www src]$ rpm -ivh --test perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm
警告: perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
[goun@www src]$
[goun@www src]$ sudo rpm -ivh perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm
警告: perl-rrdtool-1.0.50-3.rh9.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:perl-rrdtool           ########################################### [100%]
[goun@www src]$

perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm インストール

[goun@www src]$ wget http://dag.wieers.com/rpm/packages/perl-HTML-Template/perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm
--17:44:56--  http://dag.wieers.com/rpm/packages/perl-HTML-Template/perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm
           => `perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm'
dag.wieers.com をDNSに問いあわせています... 完了しました。
dag.wieers.com[217.22.63.77]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: http://apt.sw.be/packages/perl-HTML-Template/perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm [続く]
--17:44:57--  http://apt.sw.be/packages/perl-HTML-Template/perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm
           => `perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm'
apt.sw.be をDNSに問いあわせています... 完了しました。
apt.sw.be[193.1.193.67]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 62,090 [application/x-redhat-package-manager]

100%[==========================================================>] 62,090        37.20K/s    ETA 00:00

17:44:59 (37.20 KB/s) - `perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm' を保存しました [62090/62090]

[goun@www src]$ rpm -ivh --test perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm
警告: perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
[goun@www src]$
[goun@www src]$ sudo rpm -ivh perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm
警告: perl-HTML-Template-2.8-1.0.rh9.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:perl-HTML-Template     ########################################### [100%]
[goun@www src]$

もう一度動くか確認・・・

[goun@www src]$ sudo /opt/munin/bin/munin-cron                                                       You are running this program as root, which is neither smart nor necessary.
If you really want to run it as root, use the --force-root option. Else, run
it as the user "munin". Aborting.

You are running this program as root, which is neither smart nor necessary.
If you really want to run it as root, use the --force-root option. Else, run
it as the user "munin". Aborting.

You are running this program as root, which is neither smart nor necessary.
If you really want to run it as root, use the --force-root option. Else, run
it as the user "munin". Aborting.

You are running this program as root, which is neither smart nor necessary.
If you really want to run it as root, use the --force-root option. Else, run
it as the user "munin". Aborting.

[goun@www src]$
[goun@www src]$
[goun@www src]$ sudo -u munin /opt/munin/bin/munin-cron

エラーでなくなった

ブラウザから確認・・・

html出力先確認

[goun@www src]$ grep htmldir /etc/opt/munin/munin.conf
htmldir /opt/munin/var/www
[goun@www src]$

これらがApache経由で見れるよう設定して、
ブラウザからみる。

munin-nodeが動いていないので、グラフ出力がないけど
とりあえず見えた。

で、今度はmunin-nodeの動作確認・・・

munin-node 設定

どのpluginを使うか自動的に判断して、アクティブにしてくれるツールがあるので
これを使う。まずどのpluginが使えるか確認

[goun@www src]$ /opt/munin/sbin/munin-node-configure --shell
ln -s /opt/munin/lib/plugins/cpu /etc/opt/munin/plugins/cpu
ln -s /opt/munin/lib/plugins/df /etc/opt/munin/plugins/df
ln -s /opt/munin/lib/plugins/df_inode /etc/opt/munin/plugins/df_inode
ln -s /opt/munin/lib/plugins/entropy /etc/opt/munin/plugins/entropy
ln -s /opt/munin/lib/plugins/forks /etc/opt/munin/plugins/forks
ln -s /opt/munin/lib/plugins/if_ /etc/opt/munin/plugins/if_eth0
ln -s /opt/munin/lib/plugins/if_ /etc/opt/munin/plugins/if_eth1
ln -s /opt/munin/lib/plugins/if_err_ /etc/opt/munin/plugins/if_err_eth0
ln -s /opt/munin/lib/plugins/if_err_ /etc/opt/munin/plugins/if_err_eth1
ln -s /opt/munin/lib/plugins/interrupts /etc/opt/munin/plugins/interrupts
ln -s /opt/munin/lib/plugins/iostat /etc/opt/munin/plugins/iostat
ln -s /opt/munin/lib/plugins/irqstats /etc/opt/munin/plugins/irqstats
ln -s /opt/munin/lib/plugins/load /etc/opt/munin/plugins/load
ln -s /opt/munin/lib/plugins/memory /etc/opt/munin/plugins/memory
ln -s /opt/munin/lib/plugins/netstat /etc/opt/munin/plugins/netstat
ln -s /opt/munin/lib/plugins/open_files /etc/opt/munin/plugins/open_files
ln -s /opt/munin/lib/plugins/open_inodes /etc/opt/munin/plugins/open_inodes
ln -s /opt/munin/lib/plugins/postfix_mailqueue /etc/opt/munin/plugins/postfix_mailqueue
ln -s /opt/munin/lib/plugins/processes /etc/opt/munin/plugins/processes
ln -s /opt/munin/lib/plugins/swap /etc/opt/munin/plugins/swap
ln -s /opt/munin/lib/plugins/vmstat /etc/opt/munin/plugins/vmstat
[goun@www src]$

実際にアクティブ化する。

[goun@www src]$ sudo sh -c "/opt/munin/sbin/munin-node-configure --shell | sh"
[goun@www src]$ ls -al /etc/opt/munin/plugins
合計 8
drwxr-xr-x    2 root     root         4096  2月 19 18:00 .
drwxr-xr-x    5 root     root         4096  2月 19 17:31 ..
lrwxrwxrwx    1 root     root           26  2月 19 18:00 cpu -> /opt/munin/lib/plugins/cpu
lrwxrwxrwx    1 root     root           25  2月 19 18:00 df -> /opt/munin/lib/plugins/df
lrwxrwxrwx    1 root     root           31  2月 19 18:00 df_inode -> /opt/munin/lib/plugins/df_inode
lrwxrwxrwx    1 root     root           30  2月 19 18:00 entropy -> /opt/munin/lib/plugins/entropy
lrwxrwxrwx    1 root     root           28  2月 19 18:00 forks -> /opt/munin/lib/plugins/forks
lrwxrwxrwx    1 root     root           30  2月 19 18:00 if_err_eth0 -> /opt/munin/lib/plugins/if_err_
lrwxrwxrwx    1 root     root           30  2月 19 18:00 if_err_eth1 -> /opt/munin/lib/plugins/if_err_
lrwxrwxrwx    1 root     root           26  2月 19 18:00 if_eth0 -> /opt/munin/lib/plugins/if_
lrwxrwxrwx    1 root     root           26  2月 19 18:00 if_eth1 -> /opt/munin/lib/plugins/if_
lrwxrwxrwx    1 root     root           33  2月 19 18:00 interrupts -> /opt/munin/lib/plugins/interrupts
lrwxrwxrwx    1 root     root           29  2月 19 18:00 iostat -> /opt/munin/lib/plugins/iostat
lrwxrwxrwx    1 root     root           31  2月 19 18:00 irqstats -> /opt/munin/lib/plugins/irqstats
lrwxrwxrwx    1 root     root           27  2月 19 18:00 load -> /opt/munin/lib/plugins/load
lrwxrwxrwx    1 root     root           29  2月 19 18:00 memory -> /opt/munin/lib/plugins/memory
lrwxrwxrwx    1 root     root           30  2月 19 18:00 netstat -> /opt/munin/lib/plugins/netstat
lrwxrwxrwx    1 root     root           33  2月 19 18:00 open_files -> /opt/munin/lib/plugins/open_files
lrwxrwxrwx    1 root     root           34  2月 19 18:00 open_inodes -> /opt/munin/lib/plugins/open_inodes
lrwxrwxrwx    1 root     root           40  2月 19 18:00 postfix_mailqueue -> /opt/munin/lib/plugins/postfix_mailqueue
lrwxrwxrwx    1 root     root           32  2月 19 18:00 processes -> /opt/munin/lib/plugins/processes
lrwxrwxrwx    1 root     root           27  2月 19 18:00 swap -> /opt/munin/lib/plugins/swap
lrwxrwxrwx    1 root     root           29  2月 19 18:00 vmstat -> /opt/munin/lib/plugins/vmstat
[goun@www src]$

munin-node を cron へ登録

5分周期で起動するよう登録

[goun@www munin-1.2.5]$ sudo vi /etc/cron.d/munin
*/5 * * * *     munin test -x /usr/bin/munin-cron && /usr/bin/munin-cron

/etc/init.d/munin-node を作る

リンク張って。

[goun@www munin-1.2.5]$ sudo ln -s `pwd`/dists/redhat/munin-node.rc /etc/init.d/munin-node

動かしてみる

[goun@www munin-1.2.5]$ sudo /etc/init.d/munin-node
Usage: munin-node {start|stop|status|restart}
[goun@www munin-1.2.5]$ sudo /etc/init.d/munin-node status
munin-nodeは停止しています
[goun@www munin-1.2.5]$ sudo /etc/init.d/munin-node start
Starting Munin Node: /etc/init.d/munin-node: line 24: /usr/sbin/munin-node: そのようなファイルやディレクトリはありません
                                                           [  OK  ]
[goun@www munin-1.2.5]$ sudo /etc/init.d/munin-node stop
Stopping Munin Node agents: cat: /var/run/munin/munin-node.pid: そのようなファイルやディレクトリはありません
kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
                                                           [失敗]
[goun@www munin-1.2.5]$

エラーでた。

パスがちがってるので、リンクしておく。

[goun@www munin-1.2.5]$ sudo ln -s /opt/munin/sbin/munin-node /usr/sbin/munin-node
[goun@www munin-1.2.5]$ sudo /etc/init.d/munin-node start
Starting Munin Node: Can't locate Net/Server/Fork.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0) at /usr/sbin/munin-node line 130.
BEGIN failed--compilation aborted at /usr/sbin/munin-node line 130.
                                                           [  OK  ]
[goun@www munin-1.2.5]$

Can't locate Net/Server/Fork.pm in @INC
ということなので・・・

perl-Net-Server-0.94-1.rh9.rf.noarch.rpm インストール

[goun@www src]$ wget http://dag.wieers.com/rpm/packages/perl-Net-Server/perl-Net-Server-0.94-1.rh9.rf.noarch.rpm
--18:13:50--  http://dag.wieers.com/rpm/packages/perl-Net-Server/perl-Net-Server-0.94-1.rh9.rf.noarch.rpm
           => `perl-Net-Server-0.94-1.rh9.rf.noarch.rpm'
dag.wieers.com をDNSに問いあわせています... 完了しました。
dag.wieers.com[217.22.63.77]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: http://apt.sw.be/packages/perl-Net-Server/perl-Net-Server-0.94-1.rh9.rf.noarch.rpm [続く]
--18:13:50--  http://apt.sw.be/packages/perl-Net-Server/perl-Net-Server-0.94-1.rh9.rf.noarch.rpm
           => `perl-Net-Server-0.94-1.rh9.rf.noarch.rpm'
apt.sw.be をDNSに問いあわせています... 完了しました。
apt.sw.be[193.1.193.67]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 146,753 [application/x-redhat-package-manager]

100%[====================================================================================>] 146,753       27.60K/s    ETA 00:00

18:13:57 (27.60 KB/s) - `perl-Net-Server-0.94-1.rh9.rf.noarch.rpm' を保存しました [146753/146753]

[goun@www src]$
[goun@www src]$ rpm -ivh --test perl-Net-Server-0.94-1.rh9.rf.noarch.rpm
警告: perl-Net-Server-0.94-1.rh9.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
[goun@www src]$
[goun@www src]$ sudo rpm -ivh perl-Net-Server-0.94-1.rh9.rf.noarch.rpm
警告: perl-Net-Server-0.94-1.rh9.rf.noarch.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:perl-Net-Server        ########################################### [100%]
[goun@www src]$

/etc/init.d/munin-node の再確認

[goun@www src]$ sudo /etc/init.d/munin-node start
Starting Munin Node:                                       [  OK  ]
[goun@www src]$ sudo /etc/init.d/munin-node status
munin-node (pid 1173) を実行中...
[goun@www src]$ ps -ef | grep munin
root      1173     1  0 18:21 ?        00:00:00 /usr/sbin/munin-node
goun     1275 28013  0 18:21 pts/1    00:00:00 grep munin
[goun@www src]$

おっけー

munin-node の自動起動登録

[goun@www goun]$ sudo /sbin/chkconfig --add munin-node
[goun@www goun]$ sudo /sbin/chkconfig --list | grep munin-node
munin-node      0:オフ  1:オフ  2:オン  3:オン  4:オン  5:オン  6:オフ
[goun@www goun]$

グラフ描画されてるか確認

以上でグラフ描画されるはず・・・
なのだが、描画されない・・・

ん〜
munin-nodeが動いてないのかな・・・
確認してみる。

[goun@www goun]$ telnet localhost 4949
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at www.hoge.com
list
open_inodes if_err_eth0 irqstats entropy processes postfix_mailqueue if_eth0 df netstat interrupts swap load cpu df_inode if_eth1 if_err_eth1 forks iostat open_files memory vmstat
fetch processes
processes.value 80
.
quit
Connection closed by foreign host.
[goun@www goun]$

正常だな。

いろいろ調べる・・・
パスちがってるのみつけた。リンク張る。

[goun@www munin-1.2.5]$ sudo ln -s /opt/munin/bin/munin-cron /usr/bin/munin-cron

これで描画を確認できた。

最終更新時間:2007年02月20日 00時46分28秒