mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-01 05:43:44 +00:00
Initial version
This commit is contained in:
parent
42bec47611
commit
1b1c6c4069
1 changed files with 28 additions and 0 deletions
28
plugins/other/tor_traffic
Executable file
28
plugins/other/tor_traffic
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# (c)2010 lists@nerdbynature.de
|
||||||
|
#
|
||||||
|
# Get accounting information from a running Tor server.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
COOKIE=/opt/tor/.tor/control_auth_cookie
|
||||||
|
PORT=9051
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$1" = config ]; then
|
||||||
|
echo "graph_title Tor Traffic"
|
||||||
|
echo "graph_args --base 1000"
|
||||||
|
echo "graph_vlabel bytes in / out"
|
||||||
|
echo "graph_category network"
|
||||||
|
echo "down.label Download"
|
||||||
|
echo "down.type GAUGE"
|
||||||
|
echo "up.label Upload"
|
||||||
|
echo "up.type GAUGE"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
/bin/echo -e "AUTHENTICATE \"`cat $COOKIE`\"\nGETINFO accounting/bytes\nQUIT" | nc localhost $PORT | \
|
||||||
|
awk -F= '/accounting\/bytes/ {print $2}' | \
|
||||||
|
tr -d '\015' | \
|
||||||
|
awk '{print "down.value "$1 "\nup.value "$2}'
|
Loading…
Add table
Add a link
Reference in a new issue