Révision 9388a59d
Initial version
| plugins/other/amule_shares | ||
|---|---|---|
| 1 |
#!/bin/sh |
|
| 2 |
# |
|
| 3 |
# Plugin to monitor the number of shared files with 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 shares 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_title aMule shared files" |
|
| 46 |
echo 'graph_info This graph shows the number of shared files on aMule .' |
|
| 47 |
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>' |
|
| 48 |
echo 'graph_args -l 0 --base 1000' |
|
| 49 |
echo 'graph_vlabel no of shares' |
|
| 50 |
echo 'graph_category amule' |
|
| 51 |
echo 'shares.label shared files' |
|
| 52 |
echo 'shares.draw AREA' |
|
| 53 |
exit 0 |
|
| 54 |
fi |
|
| 55 |
|
|
| 56 |
cat /tmp/amulesig.dat | tr '\n' ';' | awk -F ";" "{ print \"shares.value \" \$10 }"
|
|
Formats disponibles : Unified diff