cacti安裝成功了,下載一個(gè)npc插件來套用nagios,nagios要用ndoutils和cacti連接。
創(chuàng)新互聯(lián)長期為1000+客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺(tái),與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為鶴慶企業(yè)提供專業(yè)的網(wǎng)站制作、網(wǎng)站設(shè)計(jì),鶴慶網(wǎng)站改版等技術(shù)服務(wù)。擁有十年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。
主要安裝ndoutils出現(xiàn)的問題。
啟動(dòng)ndoutils時(shí)出錯(cuò):
/usr/local/nagios/bin/ndo2db-3x -c /usr/local/nagios/etc/ndo2db.cfg
錯(cuò)誤提示:
Support for the specified database server is either not yet supported, or was not found on your system
原因:MySQL的庫文件沒有被加載,編譯是時(shí)注意:
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
以上藍(lán)色部分是否都有。
解決方法:
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
編譯安裝不是親測的。
就可以啟動(dòng)了,
啟動(dòng)后還是不現(xiàn)實(shí)
查看日志:
tail -30 /var/log/message
錯(cuò)誤:
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后還是不顯示,
在看日志又出現(xiàn):
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;
把以上內(nèi)容寫入naigos.sql
運(yùn)行:
mysql -u root -p nagios < naigos.sql
輸入密碼:
再重啟naigos。
終于出現(xiàn)了內(nèi)容:
以上是個(gè)人整理。詳細(xì)內(nèi)容請(qǐng)看:
http://ppp1013.blog.51cto.com/927700/214781
http://blog.csdn.net/xiangliangyu2008/article/details/7758750