Prev / Next

2009-02-09 / munin の plugin 自動設定

第 1 回 静岡 IT Pro 勉強会([2009-02-07-1])のディスカッションで,
munin は plugin を自動設定してくれて便利
という話がでたんだけど,どうやっているのか気になったので,
ちょっと調べてみた.

- munin-node インストール時には設定されている
- munin-node を再起動したりしても変更されない
ということはわかっているので,
インストール時に何かしているはず,
ということで spec ファイルを見てみると,以下のような記述が.

%post node
/sbin/chkconfig --add munin-node
%{_sbindir}/munin-node-configure --shell 2> /dev/null | sh >& /dev/null || :


どうやら,munin-node-configure でどんなサービスが動いているか確認しているよう.

Usage: /usr/sbin/munin-node-configure [options]

Options:
       --help                  View this help page
       --version               Show version information
       --debug                 View debug information (very verbose)
       --config <file>         Override configuration file
                               [/etc/munin/munin-node.conf]
       --servicedir <dir>      Override plugin dir [/etc/munin/plugins]
       --libdir <dir>          Override plugin lib [/usr/share/munin/plugins]
       --families <family,...> Override families (auto,manual,contrib) [auto]
       --suggest               Show suggestions instead of status
       --shell                 Show shell commands (implies --suggest)
       --remove-also           Also show rm-commands when doing --shell
       --newer <version>       Only show suggestions related to plugins newer
                               than version <version>. [0.0.0]
       --snmp <host|cidr>      Do SNMP probing on the host or CIDR network.
       --snmpversion <ver>     Set SNMP version (1, 2c or 3) [2c]
       --snmpcommunity <comm>  Set SNMP community [public]


で,--shell オプションでリンクの生成コマンドの表示と
サジェストをしてくれる.

ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes
ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/apache_volume


こんな感じの出力.

spec ファイルでは,これを sh に渡してリンクの作成までして,
自動設定してくれている.

Referrer (Inside):
[2010-08-13-1] munin でグラフが生成されない
[2009-07-03-2] munin の apahce プラグイン
[2009-07-03-1] munin の NFSv4 プラグイン
comments powered by Disqus