侧边栏壁纸
  • 累计撰写 35 篇文章
  • 累计创建 14 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

zabbix与OB的兼容性测试

子曰
2023-03-15 / 0 评论 / 0 点赞 / 277 阅读 / 949 字 / 正在检测是否收录...

一、遇到的问题

  1. 触发器问题:ob不支持触发器,所有触发器都建在changelog表。(zabbix版本从6.0 升级到6.2)
  2. ob不支持把text修改为varchar,在4.0版本之后支持,问题暂时搁置。(zabbix版本从6.0 升级到6.2)
  3. changelog表的问题,从代码上看是升级时要写数据,使用触发器,需要再验证。(zabbix版本从6.0 升级到6.2)
  4. zabbix添加机器后,重启zabbix server 才能连通的问题,可能与程序有关,同一个程序,在使用mysql时,没有问题。(zabbix 6.2使用过程中的问题,比较致命,重点处理)

二、问题处理

2.1 agent端每隔一分钟cannot accept incoming connection for peer

2022/07/29 12:08:20.036465 cannot accept incoming connection for peer: 10.0.2.39

修改/data/config/oss/zabbix/zabbix_agent2.confListenIP=0.0.0.0解决

2.2 添加机器后不可用的问题

image

image-20220729143025313

处理步骤:

对比两个配置在数据库里有什么不同。两条SQL,先查出对应的hostid,在根据hostid查hosts表。

obclient [zabbix]> select * from interface where ip in ('10.0.9.146','10.0.9.147') limit 10 \G
*************************** 1. row ***************************
  interfaceid: 86
       hostid: 10618
         main: 1
         type: 1
        useip: 1
           ip: 10.0.9.146
          dns:
         port: 31350
    available: 1
        error:
  errors_from: 0
disable_until: 0
*************************** 2. row ***************************
  interfaceid: 91
       hostid: 10623
         main: 1
         type: 1
        useip: 1
           ip: 10.0.9.147
          dns:
         port: 31350
    available: 0
        error:
  errors_from: 0
disable_until: 0
2 rows in set (0.015 sec)

obclient [zabbix]> select * from hosts where hostid in (10618,10623)\G
*************************** 1. row ***************************
            hostid: 10618
      proxy_hostid: NULL
              host: omt-dgd001
            status: 0
     ipmi_authtype: -1
    ipmi_privilege: 2
     ipmi_username:
     ipmi_password:
     maintenanceid: NULL
maintenance_status: 0
  maintenance_type: 0
  maintenance_from: 0
              name: omt-dgd001
             flags: 0
        templateid: NULL
       description:
       tls_connect: 1
        tls_accept: 1
        tls_issuer:
       tls_subject:
  tls_psk_identity:
           tls_psk:
     proxy_address:
     auto_compress: 1
          discover: 0
 custom_interfaces: 0
              uuid:
*************************** 2. row ***************************
            hostid: 10623
      proxy_hostid: NULL
              host: omt-dgd002
            status: 0
     ipmi_authtype: -1
    ipmi_privilege: 2
     ipmi_username:
     ipmi_password:
     maintenanceid: NULL
maintenance_status: 0
  maintenance_type: 0
  maintenance_from: 0
              name: omt-dgd002
             flags: 0
        templateid: NULL
       description:
       tls_connect: 1
        tls_accept: 1
        tls_issuer:
       tls_subject:
  tls_psk_identity:
           tls_psk:
     proxy_address:
     auto_compress: 1
          discover: 0
 custom_interfaces: 0
              uuid:
2 rows in set (0.001 sec)

可以看到,在 interface 表中字段available的值不同,可以根据表结构去代码里搜。

修改配置文件/usr/local/zabbix-6.2.0/etc/zabbix_server.conf,配置zabbix server日志级别 DebugLevel=4.

相关配置说明:

DebugLevel

取值范围:0-5

默认值:3

说明: 指定debug级别

0 - 基本信息

1 - critical信息

2 - error信息

3 - warnings信息

4 - 调试日志,日志内容很多,慎重使用

5 - 用于调试web和vmware监控

2.3 连接到Zabbix服务器 “localhost” 失败

image-20220729164843949

修改/var/www/html/zabbix-6.2.0/conf/zabbix.conf.php前端配置文件中

// Uncomment and set to desired values to override Zabbix hostname/IP and port.
// $ZBX_SERVER                  = '';
// $ZBX_SERVER_PORT             = '';

改为正确的:
$ZBX_SERVER                     = '10.0.9.92';
$ZBX_SERVER_PORT                = '31351';

2.4 Database history tables upgraded显示为No

1、zabbix前端报错’'Database history tables upgraded"显示为“no”,这个其实是表里面的错误,修改方法是/etc/zabbix/web/zabbix.conf.php文件里面加一行参数,$DB[‘DOUBLE_IEEE754’] = true即可。详情链接:

https://support.zabbix.com/browse/ZBX-17711

2、trousers包

zabbix默认情况下要求trousers包的版本是0.3.12版本以上。如果低于这个版本,有可能zabbix-server服务启动不成功。在mysql7.1版本以上可能会使用老版本的trousers版本,这点要注意。

2.5 zabbix主动模式与被动模式的解释

「Zabbix」- 主动模式(Active checks)与被动模式(Passive checks) - K4NZ BLOG

image-20220801163035154

0

评论区