Nagios是一款開源的系統和網絡監控應用,它可以監視你指定的主機與服務,當出現問題時提醒您以幫助你改善系統。 Nagios最初在Linux下運行,但它大多數其他Unix下運行。 Nagios 功能包括: 監控網絡服務( SMTP , POP3 , HTTP , NNTP , PING等) 監控主機
Nagios是一款開源的系統和網絡監控應用,它可以監視你指定的主機與服務,當出現問題時提醒您以幫助你改善系統。 Nagios最初在Linux下運行,但它大多數其他Unix下運行。
Nagios 功能包括:
在安裝之前你最好已經安裝了lamp服務器軟件,另外你還需要安裝一些依賴包,使用下面的命令:
sudo apt-get install wget build-essential php5-gd wget libgd2-xpm libgd2-xpm-dev libapache2-mod-php5 apache2-utils daemon
下載Nagios及插件:
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
wget http://nchc.dl.sourceforge.net/project/nagios-cn/sourcecode/zh_CN%203.2.3/nagios-cn-3.2.3.tar.bz2
wget http://nchc.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.3/nagios-3.2.3.tar.gz
添加 Nagios 用戶和群組
adduser nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd www-data
現在安裝 nagios
盡量使用 root 身份登錄,運行以下命令
解壓縮下載的文件(Nagios的內核和插件)
1、Nagios內核安裝:
tar zxvf nagios-3.2.3.tar.gz
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-3.2.3/
apt-get install sendmail
./configure --with-nagios-group=nagios --with-command-group=nagcmd --with-mail=/usr/sbin/sendmail
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
2、插件安裝
cd ..
cd nagios-plugins-2.0.3/
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
apt-get install libxml2
apt-get install libxml2-dev
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server
sudo touch /var/www/test.php
vim /var/www/test.php
sudo apt-get install php5-gd php5-curl php5-xdebug
sudo /etc/init.d/nagios restart
3、安裝中文插件
cd ..
tar xvf nagios-cn-3.2.3.tar.bz2
cd nagios-cn-3.2.3/
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make all
make
make install
make install-init
make install-commandmode
make install-config
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
sudo /etc/init.d/nagios restart
訪問nagios地址:http://localhost/nagios
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com