qian51 发表于 2015-04-08 16:11

zabbix监控MySQL

zabbix-agent客户端脚本如下:
#!/bin/bash
mysql=$(which mysql)
var=$1
MySQL_USER=$2
MySQL_PASSWORD=$3
MySQL_HOST=$4
[ "${MySQL_USER}" == '' ] && MySQL_USER=zabbix
[ "${MySQL_PASSWORD}" == '' ] && MySQL_PASSWORD=zabbix
[ "${MySQL_HOST}" == '' ] && MySQL_HOST=192.168.1.96
[ "${var}" = '' ] && echo "" || ${mysql} -u${MySQL_USER} -p${MySQL_PASSWORD} -h${MySQL_HOST}-e 'show status' | grep -v Variable_name | grep "\b${var}\b" | awk '{print $2}'
然后修改了zabbix_agentd.conf:
UserParameter=mysql.status[*],/etc/zabbix/moniter/moniter-mysql.sh $1
在server端查看日志如下:
1980:20150408:160010.795 item ] became not supported: Received value [] is not suitable for value type
1980:20150408:160010.796 item ] became not supported: Received value [] is not suitable for value type
1980:20150408:160010.797 item ] became not supported: Received value [] is not suitable for value type ,是什么原因呢

roc-polaris 发表于 2015-04-20 18:22

前端ITEM怎么配置的?数据类型是什么?

qingge612 发表于 2015-08-21 11:57

我的也是这个问题。
5500:20150820:185617.468 error reason for "client19:mysql.status" changed: Received value [] is not suitable for value type :Q:Q:Q:Q:Q

guofzhao 发表于 2015-08-25 09:30

@楼主,这个错误已经说的很清楚了
item ] became not supported: Received value [] is not suitable for value type

意思是,你这个item,获取到的数据是[],没获取到正确的数据。是监控脚本写的有问题。

xinzhuzhi 发表于 2015-09-11 13:58

zabbix要脚本返回数值,你这个脚本有问题。

ruochen 发表于 2015-09-29 19:01

用MPM的一套吧

Roarain2 发表于 2015-11-17 14:58

可以用模板监控mysql,或者可以用mysqlbix
页: [1]
查看完整版本: zabbix监控MySQL