当前位置:网站首页>zabbix_get测试数据库失败
zabbix_get测试数据库失败
2022-07-06 23:54:00 【知本知至】
环境
[email protected]:zabbix#cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.38-0ubuntu0.18.04.1 |
+-------------------------+
1 row in set (0.00 sec)
[email protected]:zabbix_server#sbin/zabbix_server -V
zabbix_server (Zabbix) 4.0.42
Revision f5370d9acb1 28 June 2022, compilation time: Jul 3 2022 13:46:14
Copyright (C) 2022 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.
描述
在配置zabbix自定义监控脚本进行监控从数据库时,
自定义脚本在本地跑起来正常,在zabbis server上使用zabbix_get命令时候就出现错误
[email protected]:bin#/apps/zabbix_server/bin/zabbix_get -s 10.0.0.84 -p 10050 -k "mysql_status[master_slave_check]"
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
100
脚本,监控项等等都没有问题。
原因
MySQL启用了auth_socket plugin插件导致的。
auth_socket plugin 套接字插件检查套接字用户名(操作系统用户名)是否与客户端程序为服务器指定的MySQL用户名匹配。 如果名称不匹配,插件将检查套接字用户名是否 authentication_string 与 mysql.user 系统表行 的 列中 指定的名称匹配 。 如果找到匹配项,则插件允许连接。
验证
[email protected]:zabbix#mysql -uroot -e 'select user,host,plugin from mysql.user;'
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| zabbix | 10.0.0.% | mysql_native_password |
解决
修改root用户的密码认证插件为mysql_native_password
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set plugin='mysql_native_password' where user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 2 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host,plugin from user;
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | mysql_native_password |
在zabbix_server进行测试
[email protected]:bin#/apps/zabbix_server/bin/zabbix_get -s 10.0.0.84 -p 10050 -k "mysql_status[master_slave_check]"
50
边栏推荐
- 京东商品详情页API接口、京东商品销量API接口、京东商品列表API接口、京东APP详情API接口、京东详情API接口,京东SKU信息接口
- Use, configuration and points for attention of network layer protocol (taking QoS as an example) when using OPNET for network simulation
- Flinksql 读写pgsql
- 淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
- Talk about mvcc multi version concurrency controller?
- 纪念下,我从CSDN搬家到博客园啦!
- K6el-100 leakage relay
- MySQL数据库学习(8) -- mysql 内容补充
- LabVIEW is opening a new reference, indicating that the memory is full
- 拼多多新店如何获取免费流量,需要从哪些环节去优化,才能有效提升店内免费流量
猜你喜欢

ssm框架的简单案例

论文阅读【Semantic Tag Augmented XlanV Model for Video Captioning】

Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding

ForkJoin最全详解(从原理设计到使用图解)
![Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]](/img/9c/1f031400f0e201df47bd51547ff73f.png)
Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]

K6el-100 leakage relay

Différenciation et introduction des services groupés, distribués et microservices

Egr-20uscm ground fault relay

How does mapbox switch markup languages?

Jhok-zbg2 leakage relay
随机推荐
The navigation bar changes colors according to the route
利用OPNET进行网络指定源组播(SSM)仿真的设计、配置及注意点
淘寶商品詳情頁API接口、淘寶商品列錶API接口,淘寶商品銷量API接口,淘寶APP詳情API接口,淘寶詳情API接口
Mapbox Chinese map address
照片选择器CollectionView
Egr-20uscm ground fault relay
[paper reading] semi supervised left atrium segmentation with mutual consistency training
Flink SQL realizes reading and writing redis and dynamically generates hset key
分布式事务解决方案之2PC
Getting started with DES encryption
JVM(二十) -- 性能监控与调优(一) -- 概述
拼多多商品详情接口、拼多多商品基本信息、拼多多商品属性接口
Simple case of SSM framework
淘宝店铺发布API接口(新),淘宝oAuth2.0店铺商品API接口,淘宝商品发布API接口,淘宝商品上架API接口,一整套发布上架店铺接口对接分享
Flinksql 读写pgsql
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Summary of the mean value theorem of higher numbers
消息队列:重复消息如何处理?
sql查询:将下一行减去上一行,并做相应的计算
架构设计的五个核心要素