Last active
July 18, 2018 20:48
-
-
Save jstanley23/29fbf9c1e493addc0ac4826d4132e26f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- WinService.py 2018-06-05 19:56:57.000000000 +0000 | |
+++ WinService.new 2018-07-18 20:45:07.476079168 +0000 | |
@@ -99,8 +99,20 @@ | |
return True | |
elif status is EXCLUDED: | |
return False | |
- # 3 - Check all other DataSources | |
+ # 3 - Check for DataSources that match the service name | |
ds_monitored = False | |
+ datasource = template.datasources._getOb(self.serviceName, None) | |
+ if datasource and datasource.enabled and hasattr(datasource, 'startmode'): | |
+ status = self.getMonitored(datasource) | |
+ if status is MONITORED: | |
+ self.failSeverity = datasource.severity | |
+ self.alertifnot = datasource.alertifnot | |
+ self.monitoredStartModes = datasource.startmode.split(',') | |
+ return True | |
+ elif status is EXCLUDED: | |
+ return False | |
+ | |
+ # 4 - Check all other DataSources | |
for datasource in template.getRRDDataSources(): | |
if datasource.id != 'DefaultService' and\ | |
hasattr(datasource, 'startmode') and\ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment