bundles/icinga2: ignore lines starting with ;; in check_spam_blocklist
This commit is contained in:
parent
b73ac2b7ce
commit
3f02f7b8f5
1 changed files with 7 additions and 11 deletions
|
@ -50,17 +50,13 @@ def check_list(ip_list, blocklist, warn_ips):
|
||||||
]).decode().splitlines()
|
]).decode().splitlines()
|
||||||
for item in result:
|
for item in result:
|
||||||
if item.startswith(';;'):
|
if item.startswith(';;'):
|
||||||
msgs.append('{} - {}'.format(
|
continue
|
||||||
blocklist,
|
|
||||||
item,
|
|
||||||
))
|
|
||||||
else:
|
|
||||||
msgs.append('{} listed in {} as {}'.format(
|
msgs.append('{} listed in {} as {}'.format(
|
||||||
ip,
|
ip,
|
||||||
blocklist,
|
blocklist,
|
||||||
item,
|
item,
|
||||||
))
|
))
|
||||||
if (item in warn_ips or item.startswith(';;')) and returncode < 2:
|
if item in warn_ips and returncode < 2:
|
||||||
returncode = 1
|
returncode = 1
|
||||||
else:
|
else:
|
||||||
returncode = 2
|
returncode = 2
|
||||||
|
|
Loading…
Reference in a new issue