システムモニタnagios–インストール

2282 ワード

インストール:環境:CentOS 6.0 32bit
1、関連パッケージ
yum install httpd php gcc glibc glibc-common gd gd-devel make

 
2、ユーザー情報の作成
useradd -m nagios  passwd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

3、naiogsとnagios-pluginsをダウンロードする
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.3.1.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz

4、nagiosのコンパイルとインストール
tar zxf nagios-3.3.1.tar.gz
cd nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode

5、プロファイルの編集(先にemailアドレスを変更)
vim /usr/local/nagios/etc/objects/contacts.cfg

6、webインタフェースの配置及びログイン検証
make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin     web       
/etc/init.d/httpd restart

7.nagios-pluginsのインストールとコンパイル
tar zxf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

8、nagiosを起動する
chkconfig --add nagios
chkconfig nagios on
/etc/init.d/nagios start

9、nagiosサンプルプロファイルが正しいかどうかを確認します.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

その他の質問:make installlで次のエラーが発生した場合:
/usr/bin/install: omitting directory `includes/rss/extlib'
/usr/bin/install: omitting directory `includes/rss/htdocs'
/usr/bin/install: omitting directory `includes/rss/scripts'
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/src/nagios/html'
make: *** [install] Error 2

次のコマンドを実行します.
sed -i 's:for file in includes/rss/\*;:for file in includes/rss/\*.\*;:g' ./html/Makefile
sed -i 's:for file in includes/rss/extlib/\*;:for file in includes/rss/extlib/\*.\*;:g' ./html/Makefile

もう一度インストールすればいい