首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

nagios升级要点(从2.x到3.x)

先将当前的nagios2.9备份 cd /usr/local cp -r nagios nagios2.9 cd /etc/init.d/ cp nagios nagios2.9 升级(从2.9到3.0.3) 下载nagios-3.0.3 首先大致的看一下里面的两篇文章 whatsnew.html和upgrading.html 介绍了新版的特点和升级方法 然后开始升级工作 解压缩后执行 ./configure --with-command-group=nagios make all make install 然后验证 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 报两个warning和一个critical 两个warning是:downtime_file 和 comment_file这两个文件已经不在使用,将他们的内容添加到state_retention_file这个文件的后面 一个critical是:434行有错误,变量不能识别 解决两个warning的方法如下: 先将nagios.cfg中comments 和downtime变量注释掉 # COMMENT FILE # This is the file that Nagios will use for storing host and service # comments. #comment_file=/usr/local/nagios/var/comments.dat # DOWNTIME FILE # This is the file that Nagios will use for storing host and service # downtime data. #downtime_file=/usr/local/nagios/var/downtime.dat 查找state_retention_file=/usr/local/nagios/var/retention.dat 然后执行 cd /usr/local/nagios/var cat comments.dat >>retention.dat cat downtime.dat >>retention.dat 解决critical的方法如下 注释掉434行的#check_result_buffer_slots=4096 这个变量已经不在使用了。 然后再验证启动nagios就没问题了 需要说明:从2.x升级到3.x还有这样一点要注意 Extended host and extended service definitions have been deprecated. They are still read and processed by Nagios, but it is recommended that you move the directives found in these definitions to your host and service definitions, respectively. 我配置的有extended service,但是里面的配置信息是nagios grapher自动生产的。况且3.x是可以读的,只是推荐写到service定义中而已。我这里并没有按照这条的建议。没对原来的配置做修改。 Nagvis启动故障的排查 更新nagios之后 启动nagvis需要的NDO组件 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg 提示Could not bind socket: Address already in use 查看/usr/local/nagios/etc/ndo2db.cfg 有这样的内容 # SOCKET TYPE # This option determines what type of socket the daemon will create # an accept connections from. # Value: #   unix = Unix domain socket (default) #   tcp  = TCP socket socket_type=unix #socket_type=tcp socket是unix类型的(是一个sock文件),而不是tcp类型的(tcp端口) 原来是/usr/local/nagios/var/ndo.sock还存在(因为ndo是使用kill命令杀掉进程的) 所以删掉这个.sock文件即可 运行/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg 启

01
领券