Commit 894ab63e authored by Jonathan Michalon's avatar Jonathan Michalon

Checks: implement CheckDNSRec (4 and 6) for recursive DNS checking

parent cc13ad90
from lib.checks import *
mail = Host(ipv4='127.0.0.1', ipv6='::1')
web = Host(ipv4='127.0.0.0', ipv6='::42')
alsace = Host(ipv4='127.0.0.1', ipv6='::1')
mail = Host(ipv4='127.0.0.1', ipv6='::1')
web = Host(ipv4='127.0.0.0', ipv6='::42')
alsace = Host(ipv4='127.0.0.1', ipv6='::1')
recursif = Host(ipv4='89.234.141.66', ipv6='2a00:5881:8100:1000::3')
checks = Checks()
checks.add(CheckDNSZone, ["arn-fai.net", "netlib.re"], ip_version=4)
checks.add(CheckPing4, [mail, web])
checks.add(CheckPing6, [mail, web])
checks.add(CheckDNSRec4, [recursif])
checks.add(CheckDNSRec6, [recursif])
# checks.add(CheckSMTP4, [mail, alsace])
# checks.add(CheckSMTP6, [mail, alsace])
......@@ -121,9 +121,17 @@ class CheckDNSZone(Check):
class CheckDNSRec(Check):
def check(self, host, addr):
self.errmsg = "Unimplemented"
return False
def check(self):
command = ['dig', 'www.google.com', '@' + self.addr]
return self.exec_with_timeout(command, pattern='status: NOERROR')
class CheckDNSRec4(CheckDNSRec, Check4):
pass
class CheckDNSRec6(CheckDNSRec, Check6):
pass
class CheckDNSAut(Check):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment