Project

General

Profile

Download (338 Bytes) Statistics
| Branch: | Revision:

root / scripts / stat_mysql_slave_status @ 865f4ff4

1
#!/bin/sh
2

    
3
PARAM=${1:-noexistent}
4

    
5
CACHE_FILE=/tmp/zbx-mysql_slave_status
6
test -z `/usr/bin/find ${CACHE_FILE} -mmin -5 2>/dev/null` && \
7
	echo "SHOW SLAVE STATUS\\G" | mysql --defaults-file=/etc/mysql/debian.cnf \
8
	--batch --skip-pager --skip-column-names >${CACHE_FILE}
9
cat ${CACHE_FILE} | perl -ne "print \$1 if m/\b${PARAM}: (.+)$/"
10

    
(3-3/8)