Skip to content

Commit

Permalink
Merge tag '3.0.1' into develop
Browse files Browse the repository at this point in the history
tag 3.0.1
  • Loading branch information
Philip Carinhas committed May 3, 2018
2 parents 62be9ba + 5c9704f commit 672a184
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions ZenPacks/zenoss/DnsMonitor/datasources/DnsMonitorDataSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DnsMonitorDataSource(PythonDataSource):
ZENPACKID + '.datasources.DnsMonitorDataSource.DnsMonitorDataSourcePlugin')
timeout = 15
eventClass = '/Status/DNS'
hostname = '${dev/id}'
hostname = '${dev/titleOrId}'
dnsServer = ''
expectedIpAddress = ''

Expand Down Expand Up @@ -152,18 +152,22 @@ def onError(self, result, config):
perfData = {}
ds0 = config.datasources[0]
if hasattr(result.value, 'subFailure'):
if isinstance(result.value.subFailure.value, error.DNSNameError):
message = ("Domain {} was not found by the server".format(
ds0.params['hostname']))
respTime, respTimeOrig = (None, respTime)
if isinstance(result.value.subFailure.value, error.DNSServerError):
message = "DNS WARNING - {}".format(self.resolver.pickServer()[0])
elif isinstance(result.value.subFailure.value, InvalidAddressError):
message = ("DNS WARNING - "
"Server: {} - "
"InvalidAddressError".format(self.resolver.pickServer()[0]))
respTime = None
elif isinstance(result.value.subFailure.value, defer.TimeoutError):
message = ("CRITICAL - Plugin timed out "
"while executing system call")
respTime = None
elif isinstance(result.value.subFailure.value, error.DNSNameError):
message = "Domain {} was not found by the server".format(
ds0.params['hostname'])
respTime = respTimeOrig
else:
message = "DNS Unknown error"
else:
message = '{}'.format(result.getErrorMessage())
respTime = None
Expand Down
2 changes: 1 addition & 1 deletion ZenPacks/zenoss/DnsMonitor/objects/objects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ True
900
</property>
<property type="string" id="hostname" mode="w" >
${dev/id}
${dev/titleOrId}
</property>
<property type="string" id="expectedIpAddress" mode="w" >
${dev/manageIp}
Expand Down

0 comments on commit 672a184

Please # to comment.