设为首页 收藏本站
查看: 1143|回复: 0

[经验分享] centreon安装使用过程日志错误处理

[复制链接]

尚未签到

发表于 2019-1-26 10:12:17 | 显示全部楼层 |阅读模式
  按照上篇centreon部署文档安装centreon服务器,使用时发现centreon、nagios、系统日志出现很多报错,并且centreonweb页面不能查看监控到的主机状态,现将错误处理记录如下。
  

  
  1、使用service ndo2db start 启动nod2db时,报错:
     Starting ndo2db:Could not bind socket:  Address already in usedone.
     使用service ndo2db status 查看状态时,报错:
     ndo2db is not running but subsystem locked .
  解决办法:
     #vim /usr/local/nagios/etc/ndo2db.cfg
      socket_name=/var/run/ndo.sock
      lock_file=/usr/local/nagios/var/ndo2db.lock
     #killall ndo2db  
     #service ndo2db restart
  
2、nagios日志
     SERVER ndo2db: Warning: queue send error, retrying...
  解决办法:
     #vim /etc/sysctl.conf
      kernel.msgmax = 131072000
      kernel.msgmnb = 131072000
      kernel.msgmni = 65536000
  

  3、/usr/local/centreon/log/nagiosPerfTrace.log
     Error: Can't locate /etc/centreon/conf.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/vendor_perl/centreon/script.pm line 140.
  解决办法:
     #vim /usr/share/perl5/vendor_perl/centreon/script.pm
      config_file => "/usr/local/centreon/etc/conf.pm"
  

  4、/usr/local/centreon/log/centreontrapd.log
     couldn't do /etc/centreon/centreontrapd.pm: No such file or directory
     couldn't run /etc/centreon/centreontrapd.pm
  解决办法:
     #find / -name centreontrapd.fp  
      /usr/share/perl5/vendor_perl/centreon/script/centreontrapd.pm
     #vim /usr/share/perl5/vendor_perl/centreon/scripte/centreontrapd.pm
  /etc/centreon/centreontrapd.pm
      /usr/share/perl5/vendor_perl/centreon/script/centreontrapd.pm(替换)
  

  5、nagios的bug
     nagios日志报错 wproc: Unknown job type: 10
     补丁如下
diff --git a/base/workers.c b/base/workers.c
index 881e434..d1e1f8d 100644
--- a/base/workers.c
+++ b/base/workers.c
@@ -285,6 +285,8 @@ static void destroy_job(struct wproc_job *job)
    case WPJOB_SVC_EVTHANDLER:
    case WPJOB_GLOBAL_HOST_EVTHANDLER:
    case WPJOB_HOST_EVTHANDLER:
+   case WPJOB_HOST_PERFDATA:
+   case WPJOB_SVC_PERFDATA:
        /* these require nothing special */
        break;
    case WPJOB_CALLBACK:
@@ -763,6 +765,11 @@ static int handle_worker_result(int sd, int events, void *arg)
            run_job_callback(job, &wpres, 0);
            break;
+       case WPJOB_HOST_PERFDATA:
+       case WPJOB_SVC_PERFDATA:
+           /* these require nothing special */
+           break;
+
        default:
            logit(NSLOG_RUNTIME_WARNING, TRUE, "Worker %d: Unknown jobtype: %d\n", wp->pid, job->type);
            break;  
6、/var/log/message 有很多数据库报错
     ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_programstatus SET instance_id='1', status_update_time=FROM_UNIXTIME(1397007698), program_start_time=FROM_UNIXTIME(1397007639), is_currently_running='1', process_id='4841', daemon_mode='1', last_command_check=FROM_UNIXTIME(0), last_log_rotation=FROM_UNIXTIME(0), notifications_enabled='1', active_service_checks_enabled='1', passive_service_checks_enabled='1', active_host_checks_enabled='1', passive_host_checks_enabled='1', event_handlers_enabled='1', flap_detection_enabled='0', failure_prediction_enabled='0', process_performance_data='1', obsess_over_hosts='0', obsess_over_services='0', modified_host_attributes='0', modified_service_attributes='0', global_host_event_handler='', global_service_event_handler='' ON DUPLICATE KEY UPDATE instance_id='1', status_update_time=FROM_UNIXTIME(1397007698), program_start_time=FROM_UNIXTIME(1397007639), is_currently_running='1', process_id='4841', daemon_mode='1', last_command_check=FROM_UNIXTIME(0), last_log_rotation=FROM_UNIXTIME(0), notifications_enabled='1', active_service_checks_enabled='1', passive_service_checks_enabled='1', active_host_checks_enabled='1', passive_host_checks_enabled='1', event_handlers_enabled='1', flap_detection_enabled='0', failure_prediction_enabled='0', process_performance_data='1', obsess_over_hosts='0', obsess_over_services='0', modified_host_attributes='0', modified_service_attributes='0', global_host_event_handler='', global_service_event_handler='''
      解决办法:
      连接至数据库
      INSERT INTO nagios_programstatus SET status_update_time=FROM_UNIXTIME(1397007698), program_start_time=FROM_UNIXTIME(1397007639), is_currently_running='1', process_id='4841', daemon_mode='1', last_command_check=FROM_UNIXTIME(0), last_log_rotation=FROM_UNIXTIME(0), notifications_enabled='1', active_service_checks_enabled='1', passive_service_checks_enabled='1', active_host_checks_enabled='1', passive_host_checks_enabled='1', event_handlers_enabled='1', flap_detection_enabled='0', failure_prediction_enabled='0', process_performance_data='1', obsess_over_hosts='0', obsess_over_services='0', mo dified_host_attributes='0', modified_service_attributes='0', global_host_event_handler='', global_service_event_handler=''
  

  7、/var/log/messages中报错:
      ndo2db: Error: mysql_query() failed for 'DELETE FROM nagios_service_parentservices WHERE instance_id='1''
      ndo2db: mysql_error: 'Table 'centreon_status.nagios_service_parentservices' doesn't exist'
  解决办法:
           连接数据库
           use centreon_status;
           create table nagios_service_parentservices( instance_id int(11) default 1);
  

  8、/var/log/messages中报错:
  ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='60', alias='admin', email_address='danhanwen@sinoicity\.com', pager_address='', host_timeperiod_object_id='55', service_timeperiod_object_id='55', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0' ON DUPLICATE KEY UPDATE instance_id='1', config_type='1', contact_object_id='60', alias='admin', email_address='danhanwen@sinoicity\.com', pager_address='', host_timeperiod_object_id='55', service_timeperiod_object_id='55', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0''
  Apr  9 09:29:17 localhost ndo2db: mysql_error: 'Unknown column 'minimum_importance' in 'field list''
  解决办法:
           连接至数据库
           use centreon_status;
           alter table nagios_contacts add minimum_importance int(11)  not Null Default 0;
           INSERT INTO nagios_contacts SET instance_id='1', config_type='1', contact_object_id='60', alias='admin', email_address='danhanwen@sinoicity\.com', pager_address='', host_timeperiod_object_id='55', service_timeperiod_object_id='55', host_notifications_enabled='1', service_notifications_enabled='1', can_submit_commands='1', notify_service_recovery='0', notify_service_warning='0', notify_service_unknown='0', notify_service_critical='0', notify_service_flapping='0', notify_service_downtime='0', notify_host_recovery='0', notify_host_down='0', notify_host_unreachable='0', notify_host_flapping='0', notify_host_downtime='0', minimum_importance='0'
  

  建议将数据库错误排除后,导出一份正确的数据库文件,再次安装的时候直接通过mysqldump初始化数据库。




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-667680-1-1.html 上篇帖子: Centreon2.8 下篇帖子: Centreon如何汉化成中文
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表