lalla1 发表于 2013-5-16 08:43:23

cacti+nagios 整合遇到的问题

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.configldconfig -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。终于出现了内容:

dong5300 发表于 2013-5-17 06:28:40

人生不能像做菜、把所有的料都准备好才下锅!

心心失意 发表于 2013-5-17 19:50:41

路过,学习下

陈辉煌 发表于 2013-5-18 12:07:43

睡眠是一门艺术——谁也无法阻挡我追求艺术的脚步!

angela 发表于 2013-5-19 04:42:30

做爱做的事,交配交的人。

寂寞大萝卜 发表于 2013-5-19 05:31:14

啥时硬件也可以COPY就好了!

花蜻宽 发表于 2013-5-19 05:40:49

路过,学习下
页: [1]
查看完整版本: cacti+nagios 整合遇到的问题