I found this for mysql replication and how far the slave is behind master, works great manually.
how do i create the key in the zabbix-ui (version 5.0)
The SEC=$ throws me off
-P $1 // i just give random port because I am using multi-instance mysql
UserParameter=mysql.seconds-behind-master,SEC=$(mysql --defaults-file=/etc/zabbix/.multi.cnf -h 127.0.0.1 -P $1 -e 'show slave status\G' | grep Seconds | awk '{print $2}'); if [ "$SEC" = "NULL" ]; then SEC="-1"; fi; echo $SEC
KeyNow is as follows in the UI:
mysql.seconds-behind-master[,SEC{#MYSQLPORT}]
If ran manually with desired port it does as expected from desired host
how do i create the key in the zabbix-ui (version 5.0)
The SEC=$ throws me off
-P $1 // i just give random port because I am using multi-instance mysql
UserParameter=mysql.seconds-behind-master,SEC=$(mysql --defaults-file=/etc/zabbix/.multi.cnf -h 127.0.0.1 -P $1 -e 'show slave status\G' | grep Seconds | awk '{print $2}'); if [ "$SEC" = "NULL" ]; then SEC="-1"; fi; echo $SEC
KeyNow is as follows in the UI:
mysql.seconds-behind-master[,SEC{#MYSQLPORT}]
If ran manually with desired port it does as expected from desired host
Comment