check_bandwidth: fix icinga2 merging args

This commit is contained in:
Cyberes 2023-05-26 20:07:56 -06:00
parent 6fdc67eb43
commit f021c8cddd
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ parser.add_argument('--ignore', nargs='*', default=[], help='Interface names to
parser.add_argument('--ignore-re', default=None, help='Regex matching interface names to ignore.')
args = parser.parse_args()
# Icinga2 will merge the args to one string
if len(args.ignore) == 1:
args.ignore = args.ignore[0].split(' ')
if args.ignore_re:
ignore_re = re.compile(args.ignore_re)
else: