Apache
GCC compiler
GD development libraries
2.若是沒有安裝,則按以下方式進行安裝:
yum -y install httpd
yum -y install gcc
yum -y install glibc glibc-common
yum -y install gd gd-devel
3.建立一個nagios user併爲其設置password
useradd nagios
passwd nagios
4.建立用戶組並將nagios user和apache user加入到用戶組中
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
5.下載nagios軟件包及nagios插件
6.編譯安裝nagios
tar xzf nagios-3.0.6.tar.gz
cd nagios-3.0.6
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
7.配置web接口
make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagios
重啓apache服務器,讓剛纔的配置生效。
8.安裝nagios插件
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios group=nagios
make
make install
9.把nagios服務增長到服務清單中並設置開機自啓動
chkconfig --add nagios
chkconfig nagios o
n
10.檢查nagios服務器是否存在配置錯誤。
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
若沒有錯誤信息就啓動nagios服務器
service nagios start