Révision 9d903375
Initial version
| plugins/other/amule_queue | ||
|---|---|---|
| 1 |
#!/bin/sh |
|
| 2 |
# |
|
| 3 |
# Plugin to monitor the number of clients in the the aMule queue. |
|
| 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 queue 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 queue" |
|
| 46 |
echo 'graph_info This graph shows the number of aMule queued clients.' |
|
| 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 clients' |
|
| 50 |
echo 'graph_category amule' |
|
| 51 |
echo 'queue.label download clients' |
|
| 52 |
exit 0 |
|
| 53 |
fi; |
|
| 54 |
|
|
| 55 |
cat /tmp/amulesig.dat | tr '\n' ';' | awk -F ";" "{ print \"queue.value \" \$9 }"
|
|
Formats disponibles : Unified diff