/usr/share/munin/plugins/ に保存されますが、実際に使われるのは /etc/munin/plugins/ 内からシンボリックリンクを張られたプラグインだけです。
/etc/munin/plugins/ を閲覧すると良いでしょう。同様に、/usr/share/munin/plugins/ の中にある興味深いプラグインを有効化するには、ln -sf /usr/share/munin/plugins/plugin /etc/munin/plugins/ を使ってシンボリックリンクを作成するだけです。プラグイン名がアンダースコア「_」で終わる場合、そのプラグインはパラメータが必要という点に注意してください。シンボリックリンクの名前を使って、このパラメータを指定します。従って、たとえば「if_」プラグインは必ず if_eth0 シンボリックリンクを使って有効化しなければいけません。こうすることで、eth0 インターフェースのネットワークトラフィックを監視します。
/etc/munin/munin-node.conf ファイルの中で allow 指示文を使います。デフォルト設定は allow ^127\.0\.0\.1$ で、ローカルホストへのアクセスのみを許可します。通常、管理者はグラフ化を担当しているホストの IP アドレスを含めた同様の行を追加します。その後、service munin-node restart を使ってデーモンを再起動します。
munin-cron を (5 分ごとに) 実行します。このコマンドは /etc/munin/munin.conf にリストされているすべてのホスト (デフォルトではローカルホストのみがリストされています) からデータを収集し、時系列データを /var/lib/munin/ にある RRD ファイル (Round Robin Database、経時変化するデータを保存するために設計されたファイルフォーマット) に保存し、/var/cache/munin/www/ に含まれるグラフを使って HTML ページを生成します。
/etc/munin/munin.conf 設定ファイルにリストされていなければいけません。各マシンは完全なセクションの形でリストされています。セクションはマシンと同じ名前で、少なくとも対応する IP アドレスを指定する address エントリを持っていなければいけません。
[ftp.falcot.com]
address 192.168.0.12
use_node_name yes/var/cache/munin/www/ の内容を利用できるようにするようウェブサーバを設定することを意味しています。通常このウェブサイトへのアクセスは認証メカニズムか IP に基づくアクセス制御を使って制限されています。アクセス制御の詳細は第 11.2 節「ウェブサーバ (HTTP)」をご覧ください。
nagiosadmin ユーザが作成されます (このユーザのパスワードが尋ねられます)。他のユーザを追加するには、Apache の htpasswd コマンドを使ってユーザを /etc/nagios3/htpasswd.users ファイルに追加するだけです。Debconf 質問がインストール中に表示されない場合、dpkg-reconfigure nagios3-cgi を使って nagiosadmin のパスワードを定義することも可能です。
http://server/nagios3/ にアクセスすると、ウェブインターフェースが表示されます。特に、Nagios は自分が実行されているマシンのいくつかのパラメータを既に監視している点に注意してください。しかしながら、たとえばホストに対するコメントを追加するなどの対話型機能は動作しません。Nagios のデフォルト設定はこれらの機能を無効化し、セキュリティの理由からとても厳しい制限を設けています。
/usr/share/doc/nagios3/README.Debian で説明されている通り、いくつかの機能を有効化するには /etc/nagios3/nagios.cfg を編集し、check_external_commands パラメータを「1」に設定します。また、以下のようにして、Nagios が使うディレクトリに書き込みパーミッションを設定する必要があります。
#service nagios3 stop[...] #dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw#dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3#service nagios3 start[...]
/etc/nagios3/nagios.cfg から参照されているオブジェクト設定ファイルを使って管理されます。
/etc/nagios3/conf.d/ に含まれるファイルはオブジェクトの動作に関する良い情報源です。
例 12.3 /etc/nagios3/conf.d/falcot.cfg ファイル
define contact{
name generic-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
register 0 ; Template only
}
define contact{
use generic-contact
contact_name rhertzog
alias Raphael Hertzog
email hertzog@debian.org
}
define contact{
use generic-contact
contact_name rmas
alias Roland Mas
email lolando@debian.org
}
define contactgroup{
contactgroup_name falcot-admins
alias Falcot Administrators
members rhertzog,rmas
}
define host{
use generic-host ; Name of host template to use
host_name www-host
alias www.falcot.com
address 192.168.0.5
contact_groups falcot-admins
hostgroups debian-servers,ssh-servers
}
define host{
use generic-host ; Name of host template to use
host_name ftp-host
alias ftp.falcot.com
address 192.168.0.6
contact_groups falcot-admins
hostgroups debian-servers,ssh-servers
}
# 'check_ftp' コマンドにカスタムパラメータを渡します
define command{
command_name check_ftp2
command_line /usr/lib/nagios/plugins/check_ftp -H $HOSTADDRESS$ -w 20 -c 30 -t 35
}
# Falcot の運用する一般サービスを定義します
define service{
name falcot-service
use generic-service
contact_groups falcot-admins
register 0
}
# www-host 上の監視対象サービスを定義します
define service{
use falcot-service
host_name www-host
service_description HTTP
check_command check_http
}
define service{
use falcot-service
host_name www-host
service_description HTTPS
check_command check_https
}
define service{
use falcot-service
host_name www-host
service_description SMTP
check_command check_smtp
}
# ftp-host 上の監視対象サービスを定義します
define service{
use falcot-service
host_name ftp-host
service_description FTP
check_command check_ftp2
}ssh-servers ホストグループに所属するホストの情報です。標準的なサービスの稼動状態確認は /etc/nagios3/conf.d/services_nagios2.cfg で定義されています。