安裝 ndoutils

cd ndoutils-1.5.2
./configure --prefix=/usr/local/nagios --enable-mysql --disable-pgsql --enable-ssl --with-ndo2db-user=nagios --with-ndo2db-group=nagcmd
make
yes| cp -rp src/ndomod-3x.o /usr/local/nagios/bin/ndomod.o
yes| cp -rp src/ndo2db-3x /usr/local/nagios/bin/ndo2db
yes| cp -rp src/file2sock /usr/local/nagios/bin/
yes| cp -rp src/log2ndo /usr/local/nagios/bin/
yes| cp -rp config/ndo2db.cfg-sample /usr/local/nagios/etc/ndo2db.cfg
yes| cp -rp config/ndomod.cfg-sample /usr/local/nagios/etc/ndomod.cfg
chmod 774 /usr/local/nagios/bin/ndo*
chown nagios:nagios /usr/local/nagios/bin/ndo*
chown nagios:nagios /usr/local/nagios/etc/ndo*
yes| cp -rp daemon-init /etc/init.d/ndo2db
chmod +x /etc/init.d/ndo2db

建資料庫

mysql -u root -p
create database nagios;
grant all on nagios.* to ndouser@localhost identified by 'ndopassword';
flush privileges;
mysql -u ndouser -pndopassword nagios < db/mysql.sql

編輯 /usr/local/nagios/etc/nagios.cfg

event_broker_options=-1
broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg

編輯 /usr/local/nagios/etc/ndo2db.cfg

db_name=nagios
db_user=ndouser
db_pass=ndopassword

啟動服務

/etc/init.d/ndo2db start
/etc/init.d/nagios checkconfig
/etc/init.d/nagios reload

Q&A

Q: ndo2db 錯誤

Jul 11 19:45:01 ndo2db: Warning: Retrying message send. This can occur because you have too few messages allowed or too few total bytes allowed in message queues. You are currently using 128 of 15424 messaged and 131072 of 131072 bytes in the queue. See REAMDE for kernel tuning options

A:

echo 131072000 > /proc/sys/kernel/msgmax 
echo 131072000 > /proc/sys/kernel/msgmnb
echo 65536000 > /proc/sys/kernel/msgmni

 

Q : ndomod: Still unable to connect to data sink.

A : 連不到資料庫

 

 

 

最後修改日期: 2013 年 12 月 13 日

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。