# mysql mysql> create database cacti; mysql> GRANT all privileges ON cacti.* TO cacti@localhost IDENTIFIED BY 'cacti'; mysql> flush privileges; mysql> quit
# useradd nagios # usermod -G nagios apache # wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.3.1/nagios-3.3.1.tar.gz # tar zxf nagios-3.3.1.tar.gz # cd nagios # ./configure --prefix=/var/www/html/nagios # make all # make install # make install-init # make install-commandmode # make install-config # make install-webconf
安装插件: # wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz # tar -xf nagios-plugins-1.4.15.tar # cd nagios-plugins-1.4.15 # ./configure --prefix=/var/www/html/nagios/ # make # make install
# chown nagios.nagios /var/www/html/nagios/ -R # service httpd restart # chkconfig httpd on # service nagios restart # chkconfig --add nagios # chkconfig nagios on
将系统日志存放到mysql数据库中,以供cacti调用
# wget http://sourceforge.net/projects/nagios/files/ndoutils-1.x/ndoutils-1.4b9/ndoutils-1.4b9.tar.gz/download # tar zxvf ndoutils-1.4b9.tar.gz # cd ndoutils-1.4b9 下载补丁 # wget http://svn.centreon.com/trunk/ndoutils-patch/ndoutils1.4b9_light.patch 打补丁 # patch -p1 -N < ndoutils1.4b9_light.patch # ./configure --prefix=/var/www/html/nagios --enable-mysql --disable-pgsql --with-mysql-inc=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql # make # make install
网友评论