zabbix使用

Zabbix Web登录页面忘记Admin登录密码重置

Zabbix 忘记Admin登录密码

image-20220910122242714

解决问题

总体思路,更新mysql中user表的Admin用户的密码。

1 连接zabbix 的mysql数据库;

2 进入 zabbix 库,然后查询users表

1
2
use zabbix;
select userid,alias,passwd from users;

结果如下:

1
2
3
4
5
6
7
+--------+-------+--------------------------------------------------------------+
| userid | alias | passwd |
+--------+-------+--------------------------------------------------------------+
| 1 | Admin | $2y$10$NKGS97URtO2SMRCE6T4h5OuRg5B6Vrq6hv73tBu4ZGrX4wDw36qEi |
| 2 | guest | $2y$10$89otZrRNmde97rIyzclecuk6LwKAsHN0BcvoOKGjbT.BwMBfm7G06 |
+--------+-------+--------------------------------------------------------------+
2 rows in set (0.00 sec)

3 为Admin生产一个新的md5密码,admin是密码

1
2
3
4
root@67636a2916d6:/# echo -n admin | openssl md5
(stdin)= 21232f297a57a5a743894a0e4a801fc3
root@67636a2916d6:/#

4 更新userid=1的密码

1
update users set passwd='21232f297a57a5a743894a0e4a801fc3' where userid='1';

5 重新加载权限表

1
flush privileges;

6 可用更新后的Admin/admin 登录zabbix 的web;

方法二,zabbix 默认用户名Admin,默认密码zabbix,

步骤3中使用下面语句更新userid=1的密码为zabbix;

1
update users set passwd='5fce1b3e34b520afeffb37ce08c7cd66' where userid='1';

解释:zabbix的md5值-为,5fce1b3e34b520afeffb37ce08c7cd66

Zabbix 告警及解决过程

1. zabbix proxy 日志报错cannot send list of active checks to “10.100.3.10”: host [10.100.3.60] not found

1
2
3
403:20221021:060755.665 cannot send list of active checks to "10.100.3.10": host [10.100.3.60] not found
399:20221021:060804.003 cannot send list of active checks to "10.100.3.27": host [10.100.3.56] not found
401:20221021:060823.654 cannot send list of active checks to "10.100.3.35": host [10.100.3.61] not found

从上面报错发现这三个节点agent的配置与实际不相符。分别登录查看其 /etc/zabbix/zabbix_agentd.conf 配置文件。

查看后发现配置文件中 Hostname 字段配置的确实与实际IP不一致,修改配置文件并重启服务。

2. zabbix proxy 日志中报错cannot send list of active checks to “10.100.3.27”: host [10.100.3.27] not found

1
401:20221021:064308.089 cannot send list of active checks to "10.100.3.27": host [10.100.3.27] not found

这个报错是因为该节点配置了 zabbix agent ,但是zabbix server 的 web 页面没有添加对应的主机配置。

登录 web ,添加该节点的主机配置即可。

3. 监控页面告警 Zabbix agent is not available (or nodata for 30m)

查看 zabbix web 页面有告警

1
Zabbix agent is not available (or nodata for 30m)

登录该节点查看 agent 日志,发现如下报错:

1
17668:20221021:135647.898 active check configuration update from [10.100.3.62:10051] started to fail (ZBX_TCP_READ() timed out)

检查确认其他配置没有问题后,可能是因为默认超时时间太短(默认客户端连接 proxy 的超时时间为 3秒),修改为 30 秒,然后重启 zabbix-agent 服务即可。

1
2
3
vi /etc/zabbix/zabbix_agentd.conf
# 如果有该参数就修改,没有改参数就添加。该参数支持的范围为:1-30,默认为3
Timeout=30

重启 zabbix-agent 服务

1
systemctl restart zabbix-agent

参考链接

zabbix-agent参数

  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2022-2023 ligongzhao
  • 访问人数: | 浏览次数:

请我喝杯咖啡吧~

支付宝
微信