Projet

Général

Profil

Révision 76a8fde6

ID76a8fde61d1876d4585b7fd09aa40a5e8b0135be
Parent 9388a59d
Enfant 03c42286

Ajouté par Andrea Gozzi il y a presque 14 ans

Initial version

Voir les différences:

plugins/other/amule_transfers
1
#!/bin/sh
2
#
3
# Plugin to monitor the UL/DL speed of the aMule ed2k/KAD client.
4
# 
5
# In order to use this plugin, you need to enable the "Online Signature" feature
6
# available in aMule's configuration options. You will also need to tell aMule to save
7
# the signature file in '/tmp' .
8
# For detailed instructions with screenshots, see http://linux.andreagozzi.com/content/munin_stuff.php
9
#
10
# 
11
# Parameters understood:
12
#
13
# 	config   (required)
14
# 	autoconf (optional - used by munin-config)
15
#
16
#
17
# $Log$
18
#
19
# Revision 1.0  2008/04/21
20
# aMule UL/DL speed plugin contributed by Andrea Gozzi (asgozzi@gbhtech.com).
21
#
22
#
23
# Magic markers - optional - used by installation scripts and
24
# munin-config:
25
#
26
#%# family=auto
27
#%# capabilities=autoconf
28

  
29
if [ "$1" = "autoconf" ]; then
30
	if [ -z "$(which amule)" ]; then
31
		echo "$0: error: amule not installed"
32
		exit 1
33
	else
34
		if [ ! -e /tmp/amulesig.dat ]; then
35
			echo "$0: error: amulesig.dat not found"
36
		else
37
			echo yes
38
			exit 0
39
		fi
40
	fi
41
fi
42

  
43
if [ "$1" = "config" ]; then
44

  
45
        echo "graph_order upload download"
46
        echo "graph_title aMule traffic"
47
	echo 'graph_info This graph shows aMule DL/UL rates.'
48
	echo 'graph_info Plugin available at <a href="http://linux.andreagozzi.com/content/munin_stuff.php">http://linux.andreagozzi.com/content/munin_stuff.php</a>'
49
	echo 'graph_args -l 0 --base 1000'
50
	echo 'graph_period second'
51
	echo 'download.max 50000'
52
	echo 'download.min 0'
53
	echo 'upload.max 50000'
54
	echo 'upload.min 0'
55
        echo 'graph_vlabel bytes per ${graph_period}'
56
	echo 'graph_category amule'
57
        echo 'upload.label upload speed'
58
        echo 'download.label download speed'
59
        exit 0
60
fi;
61

  
62
cat /tmp/amulesig.dat | tr '\n' ';' |  awk -F ";" "{ print \"download.value \" \$7 }"
63
cat /tmp/amulesig.dat | tr '\n' ';' |  awk -F ";" "{ print \"upload.value \" \$8 }"

Formats disponibles : Unified diff