#nagios Ubuntu quick_start
sudo apt-get install apache2
sudo apt-get install libapache2-mod-php5
sudo apt-get install build-essential
sudo apt-get install libgd2-xpm-dev
#添加用户
sudo -s
/usr/sbin/useradd -m -s /bin/bash nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd www-data
#开始安装nagios
cd /opt/build
sudo tar xzf ../src/nagios-3.2.1.tar.gz
cd nagios-3.2.1/
sudo ./configure --with-command-group=nagcmd
sudo make all
sudo make install
sudo make install-init
sudo make install-config
sudo make install-commandmode
#生成apache配置文件
sudo make install-webconf
#生成验证密码:
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
#安装插件
cd /opt/build
sudo tar xzf ../src/nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14/
sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
sudo make
sudo make install
#设置开机自动启动
sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
#安装sendEmail
cd /opt/src
wget
sudo tar xzf sendEmail-v1.56.tar.gz
sudo cp -a sendEmail-v1.56/sendEmail /usr/local/bin
sudo chmod +x /usr/local/bin/sendEmail
安装PNP图:
apt-get install rrdtool librrds-perl php5-gd
wget
tar xzf pnp4nagios-0.6.15.tar.gz
cd pnp4nagios-0.6.15/
./configure
make all
make install
make install-webconf
make install-config
make install-init
启用apache_modrewrite
a2enmod rewrite
/etc/init.d/apache restart
配置:bulk_mode_with_npcd
配置web显示页面:
阅读(258) | 评论(0) | 转发(0) |