zabbix и mysql templates
после обновления mysql в шаблоне для узла появились:
необходимо убрать -p* и -uuser
cat userparameter_mysql.conf
в HOME=/home/zabbix создадим:
Received value [mysql: [Warning] Using a password on the command line interface can be insecure.8611868] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
необходимо убрать -p* и -uuser
cat userparameter_mysql.conf
UserParameter=mysql.version,mysql -V
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/home/zabbix mysql -N | awk '{print $$2}'
UserParameter=mysql.ping,HOME=/home/zabbix mysqladmin ping | grep -c alive
# 'sum' on data_length or index_length alone needed when we are getting this information for whole database instead of a single table
UserParameter=mysql.size[*],echo "select sum($(case "$3" in both|"") echo "data_length+index_length";; data|index) echo "$3_length";; free) echo "data_free";; esac)) from information_schema.tables$([[ "$1" = "all" || ! "$1" ]] || echo " where table_schema='$1'")$([[ "$2" = "all" || ! "$2" ]] || echo "and table_name='$2'");" | HOME=/home/zabbix mysql -N
в HOME=/home/zabbix создадим:
root@suri:/home/zabbix# cat .my.cnf
[client]
user = zabbix
password = PassW0rD
root@suri:/home/zabbix#
0 комментариев