2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

verbose mode as runtime flag

This commit is contained in:
Lasse Karstensen 2012-02-09 14:47:30 +01:00
parent 352a9baf94
commit f110d3ddb1

View File

@ -188,7 +188,7 @@ class MuninHandler(SocketServer.StreamRequestHandler):
"""
def handle(self):
print "%s: Connection from %s:%s. server args is %s" \
if self.server.args.get("verbose"): print "%s: Connection from %s:%s. server args is %s" \
% (self.server.args["name"], self.client_address[0], self.client_address[1], self.server.args)
# slow path
hostname = self.server.args["name"]
@ -264,7 +264,7 @@ def start_servers(instances):
def usage():
print "Usage: %s [--run] [--muninconf] <configfile>" % sys.argv[0]
print "Usage: %s [--run] [--verbose] [--muninconf] <configfile>" % sys.argv[0]
def main():
if len(sys.argv) <= 2:
@ -326,6 +326,8 @@ def main():
instanceconfig[k] = v
instanceconfig["plugins"] = plugins
if "--verbose" in sys.argv:
instanceconfig["verbose"] = True
instanceconfig["name"] = "%s-%s" % (instancename, portinstance)
instanceconfig["expanded_port"] = portinstance