環境: fedora 12 x64

需要套件:

httpd
mysql-server

安裝:

yum install nagios*
yum install ndoutils*

設定:

建置使用者、資料庫、權限

create databases nagios;
grant all on nagios.* to nagios@localhost identified by ‘nagios’;
flush privileges;

匯入ndo資料庫

cd /usr/share/doc/ndoutils-mysql-1.4/db
perl installdb -u nagios -p nagios -h localhost -d nagios

成功則出現

DBD::mysql::db do failed: Table ‘nagios.nagios_dbversion’ doesn’t exist at installdb line 51.
** Creating tables for version 1.4b8
Using mysql.sql for installation…
** Updating table nagios_dbversion
Done!

編輯 /etc/nagios/ndo2db.cfg 訂正資料庫的 user, password

db_user=nagios
db_pass=nagios

編輯  /etc/nagios/nagios.cfg ,加入一行

broker_module=/usr/lib64/nagios/brokers/ndomod.so config_file=/etc/nagios/ndomod.cfg

啟動 nagios 與 ndo

/etc/init.d/ndo2db restart
/etc/init.d/nagios restart

成功

more /var/log/messages

Apr 24 00:16:55 rt nagios: Caught SIGTERM, shutting down…
Apr 24 00:16:55 rt nagios: Successfully shutdown… (PID=20997)
Apr 24 00:16:56 rt nagios: Nagios 3.2.3 starting… (PID=22292)
Apr 24 00:16:56 rt nagios: Local time is Sun Apr 24 00:16:56 CST 2011
Apr 24 00:16:56 rt nagios: LOG VERSION: 2.0
Apr 24 00:16:56 rt nagios: ndomod: NDOMOD 1.4b8 (07-16-2009) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Apr 24 00:16:56 rt nagios: ndomod: Successfully connected to data sink.  0 queued items to flush.
Apr 24 00:16:56 rt nagios: Event broker module ‘/usr/lib64/nagios/brokers/ndomod.so’ initialized successfully.
Apr 24 00:16:56 rt ndo2db: Successfully connected to MySQL database
Apr 24 00:16:56 rt nagios: Finished daemonizing… (New PID=22295)

more /var/log/nagios/nagios.log

[1303575415] Caught SIGTERM, shutting down…
[1303575415] Successfully shutdown… (PID=20997)
[1303575416] Nagios 3.2.3 starting… (PID=22292)
[1303575416] Local time is Sun Apr 24 00:16:56 CST 2011
[1303575416] LOG VERSION: 2.0
[1303575416] ndomod: NDOMOD 1.4b8 (07-16-2009) Copyright (c) 2009 Nagios Core Development Team and Community Contributors
[1303575416] ndomod: Successfully connected to data sink.  0 queued items to flush.
[1303575416] Event broker module ‘/usr/lib64/nagios/brokers/ndomod.so’ initialized successfully.
[1303575416] Finished daemonizing… (New PID=22295)

ref: http://nagioswiki.com/wiki/index.php/NDOutils_on_CentOS

Related posts 相關文章
使用連線控制插件提高 MySQL 安全性
More...
使用驗證插件提高 MySQL 密碼安全性
More...
用 pv 查看 mysql restore 還原資料進度
More...
使用 sysbench 壓力測試 mysql
More...

作者

留言

撰寫回覆或留言

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