new arg stuff
This commit is contained in:
parent
e95ea2fc20
commit
bc77ebe26d
1 changed files with 8 additions and 3 deletions
|
|
@ -42,11 +42,12 @@ logger = logging.getLogger(__name__)
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Linspector is for monitoring the vital information of hosts, services and devices in a network.",
|
description="Linspector is for monitoring the vital information of hosts, services and devices in a network.",
|
||||||
epilog="linspector is not some program expecting computers to run! Visit http://linspector.org for more "
|
epilog="Linspector is not some program expecting computers to run! Visit http://linspector.org for more "
|
||||||
"information.",
|
"information.",
|
||||||
prog="linspector")
|
prog="linspector")
|
||||||
|
|
||||||
parser.add_argument("--version", action="version", version="%(prog)s " + str(__version__))
|
parser.add_argument("--version", action="version", version="%(prog)s " + str(__version__),
|
||||||
|
help="Show program's version number and exit")
|
||||||
|
|
||||||
parser.add_argument("config", metavar="CONFIGFILE",
|
parser.add_argument("config", metavar="CONFIGFILE",
|
||||||
help="The configfile to use")
|
help="The configfile to use")
|
||||||
|
|
@ -66,6 +67,9 @@ def parse_args():
|
||||||
parser.add_argument("-t", "--threads", default=1000,
|
parser.add_argument("-t", "--threads", default=1000,
|
||||||
help="Maximum number of scheduler threads (default: 1000)")
|
help="Maximum number of scheduler threads (default: 1000)")
|
||||||
|
|
||||||
|
parser.add_argument("-k", "--corethreads", default=0,
|
||||||
|
help="Number of scheduler core threads (default: 0)")
|
||||||
|
|
||||||
parser.add_argument("-x", "--delay", default=2.315379,
|
parser.add_argument("-x", "--delay", default=2.315379,
|
||||||
help="Seconds delay between scheduled jobs (default: 2.315379)")
|
help="Seconds delay between scheduled jobs (default: 2.315379)")
|
||||||
|
|
||||||
|
|
@ -114,7 +118,8 @@ def main():
|
||||||
|
|
||||||
print("Scheduling jobs. Be patient...")
|
print("Scheduling jobs. Be patient...")
|
||||||
|
|
||||||
scheduler = Scheduler({"apscheduler.threadpool.max_threads": args.threads})
|
scheduler = Scheduler({"apscheduler.threadpool.core_threads": args.corethreads,
|
||||||
|
"apscheduler.threadpool.max_threads": args.threads})
|
||||||
scheduler.start()
|
scheduler.start()
|
||||||
|
|
||||||
start_date = datetime.datetime.now()
|
start_date = datetime.datetime.now()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue