percona-monitoring-plugins icon indicating copy to clipboard operation
percona-monitoring-plugins copied to clipboard

Issue with wrapper for mysql zabbix template

Open michaelrikmas opened this issue 8 years ago • 0 comments

STEPS TO REPRODUCE:

root@localhost:~# grep yn /etc/zabbix/zabbix_agentd.d/galera.conf UserParameter=MySQL.galera.wsrep_cert_index_size,/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh yn

root@localhost:~# sh /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh yn Synced 48

That's because this line: cat $CACHEFILE | sed 's/ /\n/g; s/-1/0/g'| grep $ITEM | awk -F: '{print $2}'

FIX: In this line: cat $CACHEFILE | sed 's/ /\n/g; s/-1/0/g'| grep $ITEM | awk -F: '{print $2}'

change: $ITEM -> ^$ITEM

root@localhost:~# CACHEFILE="/tmp/localhost-mysql_cacti_stats.txt" root@localhost:~# ITEM="yn" root@localhost:~# cat $CACHEFILE | sed 's/ /\n/g; s/-1/0/g'| grep ^$ITEM | awk -F: '{print $2}' 36

michaelrikmas avatar Jul 10 '16 14:07 michaelrikmas