mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
[plugins/transmission] Lint
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
parent
897de1bbba
commit
92483a045b
1 changed files with 11 additions and 12 deletions
|
@ -76,12 +76,13 @@ find this plugin on github at http://github.com/VolatileMesh/munin-plugins
|
|||
__version__ = '1.1'
|
||||
|
||||
|
||||
import os, sys
|
||||
import os
|
||||
import sys
|
||||
from string import Template
|
||||
|
||||
plugin_name=list(os.path.split(sys.argv[0]))[1]
|
||||
host = os.getenv('host','localhost')
|
||||
port = os.getenv('port',9091)
|
||||
plugin_name = list(os.path.split(sys.argv[0]))[1]
|
||||
host = os.getenv('host', 'localhost')
|
||||
port = os.getenv('port', 9091)
|
||||
user = os.getenv('user')
|
||||
passwd = os.getenv('pass')
|
||||
title_host = '' if host in ['localhost', '127.0.0.1', '::1'] else ' on ' + host
|
||||
|
@ -132,7 +133,6 @@ def autoconf():
|
|||
print 'no python module \'transmissionrpc\' missing'
|
||||
|
||||
|
||||
|
||||
def fetch():
|
||||
import transmissionrpc
|
||||
|
||||
|
@ -173,7 +173,6 @@ def print_values_throughput(stats):
|
|||
print "up.value U"
|
||||
|
||||
|
||||
|
||||
def dumpstats():
|
||||
import transmissionrpc
|
||||
try:
|
||||
|
@ -186,14 +185,14 @@ def dumpstats():
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv)>1 :
|
||||
if sys.argv[1]=="dumpstats" :
|
||||
if len(sys.argv) > 1 :
|
||||
if sys.argv[1] == "dumpstats" :
|
||||
dumpstats()
|
||||
elif sys.argv[1]=="config" :
|
||||
elif sys.argv[1] == "config" :
|
||||
config()
|
||||
elif sys.argv[1]=="autoconf" :
|
||||
elif sys.argv[1] == "autoconf" :
|
||||
autoconf()
|
||||
elif sys.argv[1]!="":
|
||||
elif sys.argv[1] != "":
|
||||
raise ValueError, "unknown parameter '%s'" % sys.argv[1]
|
||||
|
||||
fetch()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue