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-29 00:22:15 +11:00 committed by GitHub
parent 3e4209d35f
commit 8254d01081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

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(