您好,登錄后才能下訂單哦!
cacti安裝成功了,下載一個npc插件來套用nagios,nagios要用ndoutils和cacti連接。
主要安裝ndoutils出現的問題。
啟動ndoutils時出錯:
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
錯誤提示:
Support for the specified database server is either not yet supported, or was not found on your system
原因:mysql的庫文件沒有被加載,編譯是時注意:
checking for linker flags for loadable modules... -shared
checking for mysql_config... /usr/bin/mysql_config
checking for mysql_init in -lmysqlclient... yes
MySQL library and include file(s) were found!
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating docs/docbook/en-en/Makefile
config.status: creating subst
config.status: creating include/config.h
config.status: include/config.h is unchanged
以上藍色部分是否都有。
解決方法:
yum安裝的mysql
./configure --enable-mysql
編譯安裝的mysql
./configure --enable-mysql --with-mysql=/usr/local/mysql ### mysql 路徑
把庫文件做軟連接
ln -s /usr/local/mysql/lib/* /usr/lib/
ln -s /usr/local/mysql/include/* /usr/include/
echo "/usr/lib" > /etc/ld.so.config
ldconfig -v
編譯安裝不是親測的。
就可以啟動了,
啟動后還是不現實
查看日志:
tail -30 /var/log/message
錯誤:
nagios ndo2db-3x: Error: mysql_query() failed for 'INSERT INTO nagios_configfilevariablesSET instance_id='1', configfile_id='3', varname='cfg_file', varvalue='/usr/local/nagios//etc/objects/localhost\.cfg
解決方法:
登錄mysql
輸入以下信息:
alter table nagios.nagios_configfilevariablesdrop key instance_id;alter table nagios.nagios_configfilevariables add index (instance_id, configfile_id, varname);
重啟naigos后還是不顯示,
在看日志又出現:
localhost ndo2db-3x: mysql_error: 'Unknown column 'long_output' in 'fieldlist''
解決方法:
ALTER TABLE npc_eventhandlers ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
ALTER TABLE npc_hostchecks ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
ALTER TABLE npc_hoststatus ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
ALTER TABLE npc_notifications ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
ALTER TABLE npc_servicechecks ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
ALTER TABLE npc_servicestatus ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
ALTER TABLE npc_statehistory ADD long_output TEXT NOT NULL DEFAULT '' AFTERo utput;
ALTER TABLE npc_systemcommands ADD long_output TEXT NOT NULL DEFAULT '' AFTER output;
把以上內容寫入naigos.sql
運行:
mysql -u root -p nagios < naigos.sql
輸入密碼:
再重啟naigos。
終于出現了內容:
以上是個人整理。詳細內容請看:
http://ppp1013.blog.51cto.com/927700/214781
http://blog.csdn.net/xiangliangyu2008/article/details/7758750
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。