Commit 8ba49413 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

We should ignore stderr output when checking server availablity

parent e4e851c8
...@@ -56,7 +56,7 @@ all: client-cnf mysql-clients-cnf server-cnf mariadb-config ...@@ -56,7 +56,7 @@ all: client-cnf mysql-clients-cnf server-cnf mariadb-config
systemctl enable mysqlchk.socket systemctl enable mysqlchk.socket
mysql_install_db --basedir=/usr --user=mysql --skip-test-db --innodb-log-file-size=32M mysql_install_db --basedir=/usr --user=mysql --skip-test-db --innodb-log-file-size=32M
sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.version,mysql -V' -i /etc/zabbix_agentd.conf sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.version,mysql -V' -i /etc/zabbix_agentd.conf
sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.ping,mysqladmin -u root ping | grep -c alive' -i /etc/zabbix_agentd.conf sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.ping,mysqladmin -u root ping 2> /dev/null | grep -c alive' -i /etc/zabbix_agentd.conf
sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.size[*],bash -c '\''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\\"");" | mysql -u root -N'\''' -i /etc/zabbix_agentd.conf sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.size[*],bash -c '\''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\\"");" | mysql -u root -N'\''' -i /etc/zabbix_agentd.conf
sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.discovery,l=$$(echo "show databases" | mysql -u root -N);echo -n '\''{"data":['\'';for i in $${l};do echo -n "{\\"{#DBNAME}\\": \\"$$i\\"},";done|sed -e '\''s:\\},$$:\\}:'\'';echo -n '\'']}'\'';' -i /etc/zabbix_agentd.conf sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.discovery,l=$$(echo "show databases" | mysql -u root -N);echo -n '\''{"data":['\'';for i in $${l};do echo -n "{\\"{#DBNAME}\\": \\"$$i\\"},";done|sed -e '\''s:\\},$$:\\}:'\'';echo -n '\'']}'\'';' -i /etc/zabbix_agentd.conf
sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.status[*],echo "show global status where Variable_name='\''\$$1'\'';" | mysql -u root -N | awk '\''{print $$$$2}'\''' -i /etc/zabbix_agentd.conf sed -e '/^UserParameter=device\.product.*/a UserParameter=mysql.status[*],echo "show global status where Variable_name='\''\$$1'\'';" | mysql -u root -N | awk '\''{print $$$$2}'\''' -i /etc/zabbix_agentd.conf
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment