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 ,是什么原因呢 前端ITEM怎么配置的?数据类型是什么? 我的也是这个问题。
5500:20150820:185617.468 error reason for "client19:mysql.status" changed: Received value [] is not suitable for value type :Q:Q:Q:Q:Q @楼主,这个错误已经说的很清楚了
item ] became not supported: Received value [] is not suitable for value type
意思是,你这个item,获取到的数据是[],没获取到正确的数据。是监控脚本写的有问题。 zabbix要脚本返回数值,你这个脚本有问题。 用MPM的一套吧 可以用模板监控mysql,或者可以用mysqlbix
页:
[1]