From 76a8fde61d1876d4585b7fd09aa40a5e8b0135be Mon Sep 17 00:00:00 2001 From: Andrea Gozzi Date: Sun, 19 Oct 2008 12:08:52 +0200 Subject: [PATCH] Initial version --- plugins/other/amule_transfers | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 plugins/other/amule_transfers diff --git a/plugins/other/amule_transfers b/plugins/other/amule_transfers new file mode 100755 index 00000000..4b243612 --- /dev/null +++ b/plugins/other/amule_transfers @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Plugin to monitor the UL/DL speed of the aMule ed2k/KAD client. +# +# In order to use this plugin, you need to enable the "Online Signature" feature +# available in aMule's configuration options. You will also need to tell aMule to save +# the signature file in '/tmp' . +# For detailed instructions with screenshots, see http://linux.andreagozzi.com/content/munin_stuff.php +# +# +# Parameters understood: +# +# config (required) +# autoconf (optional - used by munin-config) +# +# +# $Log$ +# +# Revision 1.0 2008/04/21 +# aMule UL/DL speed plugin contributed by Andrea Gozzi (asgozzi@gbhtech.com). +# +# +# Magic markers - optional - used by installation scripts and +# munin-config: +# +#%# family=auto +#%# capabilities=autoconf + +if [ "$1" = "autoconf" ]; then + if [ -z "$(which amule)" ]; then + echo "$0: error: amule not installed" + exit 1 + else + if [ ! -e /tmp/amulesig.dat ]; then + echo "$0: error: amulesig.dat not found" + else + echo yes + exit 0 + fi + fi +fi + +if [ "$1" = "config" ]; then + + echo "graph_order upload download" + echo "graph_title aMule traffic" + echo 'graph_info This graph shows aMule DL/UL rates.' + echo 'graph_info Plugin available at http://linux.andreagozzi.com/content/munin_stuff.php' + echo 'graph_args -l 0 --base 1000' + echo 'graph_period second' + echo 'download.max 50000' + echo 'download.min 0' + echo 'upload.max 50000' + echo 'upload.min 0' + echo 'graph_vlabel bytes per ${graph_period}' + echo 'graph_category amule' + echo 'upload.label upload speed' + echo 'download.label download speed' + exit 0 +fi; + +cat /tmp/amulesig.dat | tr '\n' ';' | awk -F ";" "{ print \"download.value \" \$7 }" +cat /tmp/amulesig.dat | tr '\n' ';' | awk -F ";" "{ print \"upload.value \" \$8 }"