/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 アドレスを含めた同様の行を追加します。その後、invoke-rc.d 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 に基づくアクセス制御を使って制限されています。対応する詳細は 「ウェブサーバ (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 が使うディレクトリに書き込みパーティションを設定する必要があります:
#
/etc/init.d/nagios3 stop
[...] #
dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
#
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
#
/etc/init.d/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' command with custom parameters define command{ command_name check_ftp2 command_line /usr/lib/nagios/plugins/check_ftp -H $HOSTADDRESS$ -w 20 -c 30 -t 35 } # Generic Falcot service define service{ name falcot-service use generic-service contact_groups falcot-admins register 0 } # Services to check on 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 } # Services to check on 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
で定義されています。