-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dns_check] Allow querying a custom record type #2653
Conversation
@@ -5,3 +5,7 @@ instances: | |||
- hostname: www.example.org | |||
nameserver: 127.0.0.1 | |||
timeout: 8 | |||
|
|||
# Specify an (optional) `record_type` to customize the record type | |||
# queried by the check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe specify that the default is A record
to avoid any confusuion?
one small comment and then |
962e050
to
fca4ef5
Compare
Thanks @hkaj! Addressed your comment, I'll merge once the CI passes |
@@ -51,12 +51,14 @@ def query_dns(self, instance, timeout): | |||
if nameserver is not None: | |||
resolver.nameservers = [nameserver] | |||
|
|||
record_type = instance.get('record_type', 'A') | |||
|
|||
status = AgentCheck.CRITICAL | |||
start_time = time.time() | |||
try: | |||
self.log.debug('Resolving hostname %s...' % hostname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we debug also record_type
?
New `record_type` optional parameter in the configuration. Along with tests: runs of the check in `test_invalid_config` now reload the config correctly and test that the expected exception is raised.
fca4ef5
to
2fae52d
Compare
👍 |
Thanks! Merging |
New `record_type` optional parameter in the configuration. Along with tests: runs of the check in `test_invalid_config` now reload the config correctly and test that the expected exception is raised.
New
record_type
optional parameter in the configuration.Along with tests: runs of the check in
test_invalid_config
now reloadthe config correctly and test that the expected exception is raised.