Dispatcher option to log output (#15230)

* Dispatcher option to log output
-o --log-output Log output into various files in the log directory
wire up -d option to be passed into scheduled commands
Caution, can fill your disk.

* style fixes

* more silly style fixes (and a typo accidentally added)

* final lint maybe?

* more lint...

* believe it or not, more lint
This commit is contained in:
Tony Murray
2023-08-21 18:28:07 -05:00
committed by GitHub
parent 7d950825a1
commit 723600751c
3 changed files with 88 additions and 20 deletions

View File

@@ -5,11 +5,10 @@ import logging
import os
import sys
import threading
from logging import info
import LibreNMS
from logging import info
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="LibreNMS Service - manages polling and other periodic processes"
@@ -23,6 +22,12 @@ if __name__ == "__main__":
)
parser.add_argument("-v", "--verbose", action="count", help="Show verbose output.")
parser.add_argument("-d", "--debug", action="store_true", help="Show debug output.")
parser.add_argument(
"-o",
"--log-output",
action="store_true",
help="Log poller ouput to files. Warning: This could use significant disk space!",
)
parser.add_argument(
"-m",
"--multiple",
@@ -61,6 +66,7 @@ if __name__ == "__main__":
sys.exit(2)
service.config.single_instance = args.multiple
service.config.log_output = args.log_output
if args.group:
if isinstance(args.group, list):