bundles/icinga2: handle dig status messages in check_spam_blocklist
This commit is contained in:
parent
8f500b121c
commit
e029329a03
1 changed files with 12 additions and 6 deletions
|
@ -50,12 +50,18 @@ def check_list(ip_list, blocklist, warn_ips):
|
||||||
dns_name
|
dns_name
|
||||||
]).decode().splitlines()
|
]).decode().splitlines()
|
||||||
for item in result:
|
for item in result:
|
||||||
|
if line.startswith(';;'):
|
||||||
|
msgs.append('{} - {}'.format(
|
||||||
|
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 and returncode < 2:
|
if (item in warn_ips or line.startswith(';;')) and returncode < 2:
|
||||||
returncode = 1
|
returncode = 1
|
||||||
else:
|
else:
|
||||||
returncode = 2
|
returncode = 2
|
||||||
|
|
Loading…
Reference in a new issue