3
# Plugin to monitor the number of bytes sent from and received by mysql.
10
# Configuration variables
12
# mysqlopts - Options to pass to mysql
14
# $Log: mysql_bytes.in,v $
15
# Revision 1.2 2004/04/27 18:58:53 jimmyo
16
# Fixed bug in mysql-plugins (Deb#233762).
18
# Revision 1.1 2004/01/02 18:50:00 jimmyo
19
# Renamed occurrances of lrrd -> munin
21
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
22
# Import of LRRD CVS tree after renaming to Munin
24
# Revision 1.7 2003/11/07 22:12:50 jimmyo
25
# Changed deprecated plugin options
27
# Revision 1.6 2003/11/07 17:43:16 jimmyo
28
# Cleanups and log entries
33
#%# capabilities=autoconf
35
MYSQLOPTS="$mysqlopts";
36
MYSQLADMIN=${mysqladmin:-mysqladmin}
38
if [ "$1" = "autoconf" ]; then
39
$MYSQLADMIN --version 2>/dev/null >/dev/null
42
$MYSQLADMIN $MYSQLOPTS extended-status 2>/dev/null >/dev/null
48
echo "no (could not connect to mysql)"
51
echo "no (mysqladmin not found)"
56
if [ "$1" = "config" ]; then
57
echo 'graph_title MySQL throughput'
58
echo 'graph_args --base 1024'
59
echo 'graph_vlabel bytes received (-) / sent (+)'
60
echo 'recv.label received'
61
echo 'recv.type COUNTER'
62
echo 'recv.draw LINE2'
63
echo 'recv.max 80000000'
66
echo 'sent.type COUNTER'
67
echo 'sent.max 80000000'
68
echo 'sent.draw LINE2'
69
echo 'sent.negative recv'
73
($MYSQLADMIN $MYSQLOPTS extended-status 2>/dev/null || ( echo Bytes_sent a a U; echo Bytes_received a a U)) | awk '/Bytes_sent/ { print "sent.value " $4} /Bytes_received/ { print "recv.value " $4}'