mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-07 06:33:15 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -13,7 +13,7 @@ This plugin implements the multigraph protocol and provides the following graphs
|
|||
transmission_throughput - monitor traffic volumes of Transmission torrents
|
||||
transmission_activity - plugin to monitor traffic speed of Transmission torrents
|
||||
|
||||
This plugin requires python and the transmissionrpc python module.
|
||||
This plugin requires python and the transmissionrpc python module.
|
||||
See http://pypi.python.org/pypi/transmissionrpc/
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
@ -64,13 +64,13 @@ find this plugin on github at http://github.com/VolatileMesh/munin-plugins
|
|||
=head1 CHANGELOG
|
||||
|
||||
=head2 1.0 - 2010/11/12
|
||||
|
||||
|
||||
first release
|
||||
|
||||
=head2 1.1 - 2011/05/29
|
||||
|
||||
|
||||
fix transmission error handling
|
||||
|
||||
|
||||
=cut
|
||||
"""
|
||||
__version__ = '1.1'
|
||||
|
@ -138,7 +138,7 @@ def autoconf():
|
|||
|
||||
def fetch():
|
||||
import transmissionrpc
|
||||
|
||||
|
||||
try:
|
||||
client = transmissionrpc.Client(host, port=port, user=user, password=passwd)
|
||||
except transmissionrpc.TransmissionError, err:
|
||||
|
@ -148,20 +148,20 @@ def fetch():
|
|||
stats = client.session_stats(10)
|
||||
print_values_throughput(stats)
|
||||
print_values_activity(stats)
|
||||
|
||||
|
||||
|
||||
|
||||
def print_values_activity(stats):
|
||||
print "multigraph {plugin_name}_activity".format(plugin_name=plugin_name)
|
||||
try:
|
||||
print "total.value %s" % stats.torrentCount
|
||||
except:
|
||||
print "total.value U"
|
||||
|
||||
|
||||
try:
|
||||
print "active.value %s" % stats.activeTorrentCount
|
||||
except:
|
||||
print "active.value U"
|
||||
|
||||
|
||||
try:
|
||||
print "paused.value %s" % stats.pausedTorrentCount
|
||||
except:
|
||||
|
@ -174,12 +174,12 @@ def print_values_throughput(stats):
|
|||
print "down.value %s" % stats.cumulative_stats['downloadedBytes']
|
||||
except:
|
||||
print "down.value U"
|
||||
|
||||
|
||||
try:
|
||||
print "up.value %s" % stats.cumulative_stats['uploadedBytes']
|
||||
except:
|
||||
print "up.value U"
|
||||
|
||||
|
||||
|
||||
|
||||
def dumpstats():
|
||||
|
@ -192,7 +192,7 @@ def dumpstats():
|
|||
stats = client.session_stats(10)
|
||||
print stats
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv)>1 :
|
||||
if sys.argv[1]=="dumpstats" :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue