Skip to content
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

Merged
merged 1 commit into from Jul 5, 2016

Conversation

olivielpeau
Copy link
Member

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.

@@ -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
Copy link
Member

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?

@hkaj
Copy link
Member

hkaj commented Jul 5, 2016

one small comment and then :shipit:

@olivielpeau olivielpeau force-pushed the olivielpeau/dns-custom-record-type branch from 962e050 to fca4ef5 Compare July 5, 2016 11:26
@olivielpeau
Copy link
Member Author

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)
Copy link
Contributor

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.
@olivielpeau olivielpeau force-pushed the olivielpeau/dns-custom-record-type branch from fca4ef5 to 2fae52d Compare July 5, 2016 11:52
@masci
Copy link
Contributor

masci commented Jul 5, 2016

👍

@olivielpeau
Copy link
Member Author

Thanks! Merging

@olivielpeau olivielpeau merged commit 2006b41 into master Jul 5, 2016
@olivielpeau olivielpeau deleted the olivielpeau/dns-custom-record-type branch July 5, 2016 12:14
truthbk pushed a commit that referenced this pull request Aug 10, 2016
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants