only poll once with --interval 0
This commit is contained in:
parent
ac45705410
commit
843d9c8121
@ -28,10 +28,13 @@ class Munin():
|
||||
|
||||
def go(self):
|
||||
"""Bootstrap method to start processing hosts's Munin stats."""
|
||||
while True:
|
||||
self.connect()
|
||||
self.process_host_stats()
|
||||
|
||||
while True and self.args.interval != 0:
|
||||
time.sleep(self.args.interval)
|
||||
self.connect()
|
||||
self.process_host_stats()
|
||||
|
||||
def connect(self):
|
||||
"""Initial connection to Munin host."""
|
||||
@ -182,7 +185,7 @@ def parse_args():
|
||||
parser.add_argument("--interval",
|
||||
type=int,
|
||||
default=60,
|
||||
help="Interval (seconds) between polling Munin host for statistics. Default: %(default)s")
|
||||
help="Interval (seconds) between polling Munin host for statistics. If set to 0, exit after polling once. Default: %(default)s")
|
||||
parser.add_argument("--noop",
|
||||
action="store_true",
|
||||
help="Don't actually send Munin data to Carbon. Default: %(default)s")
|
||||
|
Loading…
x
Reference in New Issue
Block a user