Hello guys,
I need help to solve this problem. I have zabbix server and a client host with mysql. I am trying to monitor the mysql slave replication status using UserParameter and a shell script. The script returns value of 2 if the slave is up and will return <2 if there is a problem. When i run zabbix_agentd -t slave from the client host, the return value is correct which is 2. but when i use zabbix_get from the zabbix server, it returns value of 0. What could be the problem?
Shell script:
userparam.conf:
TIA,
Kevin
I need help to solve this problem. I have zabbix server and a client host with mysql. I am trying to monitor the mysql slave replication status using UserParameter and a shell script. The script returns value of 2 if the slave is up and will return <2 if there is a problem. When i run zabbix_agentd -t slave from the client host, the return value is correct which is 2. but when i use zabbix_get from the zabbix server, it returns value of 0. What could be the problem?
Shell script:
Code:
mysql -e "show slave status\G" 2>/dev/null | grep -w 'Slave_IO_Running\|Slave_SQL_Running' | awk "{print $2}" | grep -c Yes
Code:
UserParameter=slave,/etc/zabbix/zabbix_agentd.d/mysql_slave_status.sh
Kevin