Project

General

Profile

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

root / scripts / stat_mysql_status @ 865f4ff4

1 865f4ff4 Marc Dequènes (Duck)
#!/bin/sh
2
3
PARAM=${1:-noexistent}
4
5
CACHE_FILE=/tmp/zbx-mysql_status
6
test -z `/usr/bin/find ${CACHE_FILE} -mmin -5 2>/dev/null` && \
7
	echo "SHOW GLOBAL STATUS" | 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/^${PARAM}\t([\d.]+)/"