cmake安装
./bootstrap ; make ; make install
mysql安装
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DMYSQL_DATADIR=/data/mysqldb \
-DMYSQL_TCP_PORT=3306 \
-DENABLE_DOWNLOADS=1
make && make install
chown mysql:mysql /usr/local/mysql/ -R
chown mysql:mysql /data/mysqldb/ -R
scripts/mysql_install_db --user=mysql --datadir=/data/mysqldb
service mysqld start
启动报错
The server quit without updating PID file ([FAILED]sqldb/nagios.pid)
解决办法,查看日志。pid进程是否存在。、
wget http://www.cpan.org/modules/by-module/DBD/DBI-1.634.tar.gz
wget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-4.033.tar.gz
cd DBI-1.605
perl Makefile.PL
make
make install
cd DBD-mysql-3.0008
unset LANG
perl Makefile.PL --libs="-L/usr/local/mysql/bin/mysql -lmysqlclient -L/usr/lib -lz" --cflags=-I/usr/local/mysql/include/mysql --mysql_config=/usr/local/mysql/bin/mysql_config --testhost=127.0.0.1 --
testsocket=/usr/local/mysql/tmp/mysql.sock --testdb=nagios --testuser=root --testpassword=123456 :有问题 没继续
make
make install
cd /usr/local/include
# ln -s /usr/local/mysql/include/mysql ./mysql
# cd /usr/lib64
# ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so ./libmysqlclient.so
# ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.16\
./configure --prefix=/usr/local/nagios --enable-mysql --disable-pgsql LDFLAGS=-L/usr/local/mysql/lib --with-mysql-inc=/usr/local/mysql/include/mysql --with-mysql-lib=/usr/local/mysql/lib/mysql
make
cp ./src/ndomod-3x.o /usr/local/nagios/bin
cp ./src/ndo2db-3x /usr/local/nagios/bin
cp ./src/log2ndo /usr/local/nagios/bin
cp ./src/file2sock /usr/local/nagios/bin
chown nagios:nagios /usr/local/nagios/bin/*
# cp ./config/ndo* /usr/local/nagios/etc/
# chown nagios:nagios /usr/local/nagios/etc/*
mysql -uroot -p
mysql> create database ndodb;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON nagios.* TO nagios@localhost IDENTIFIED BY ‘123456‘;
mysql> flush privileges;
mysql> \q
生成ndoutils所需要的数据库
cd db
./installdb -u n root -p 123456 -h localhost -d ndodb
也可这样:# /opt/mysql/bin/mysql -u root -p -D nagios -h localhost < ./db/mysql.sql
vi /usr/local/nagios/etc/ndo2db.cfg
db_user=nagios
db_pass=123456
vi /usr/local/nagios/etc/nagios.cfg
broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
event_broker_options=-1
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
原文地址:http://51request.blog.51cto.com/10975038/1732545