Updated dispatcher service (librenms-service.py) to accept a group list (#13413)

* Updated dispatcher service (librenms-service.py) to accept a list
of poller group identifiers to service multiple groups simultaneously
from a single instance.

This change does not preclude the user from running multiple
independent dispatcher service instances to service different poller
group identifiers.

* Corrected linting error

* Updated dispatcher service (librenms-service.py) to accept a list
of poller group identifiers to service multiple groups simultaneously
from a single instance.

This change does not preclude the user from running multiple
independent dispatcher service instances to service different poller
group identifiers.
This commit is contained in:
DanielMuller-TN
2021-10-28 08:22:15 -05:00
committed by GitHub
parent 3e4209d35f
commit 8254d01081
+9 -2
View File
@@ -15,7 +15,11 @@ if __name__ == "__main__":
description="LibreNMS Service - manages polling and other periodic processes"
)
parser.add_argument(
"-g", "--group", type=int, help="Set the poller group for this poller"
"-g",
"--group",
nargs="+",
type=int,
help="Set the poller group for this poller",
)
parser.add_argument("-v", "--verbose", action="count", help="Show verbose output.")
parser.add_argument("-d", "--debug", action="store_true", help="Show debug output.")
@@ -59,7 +63,10 @@ if __name__ == "__main__":
service.config.single_instance = args.multiple
if args.group:
service.config.group = [args.group]
if isinstance(args.group, list):
service.config.group = args.group
else:
service.config.group = [args.group]
info(
"Entering main LibreNMS service loop on {}/{}...".format(