Skip to content

Instantly share code, notes, and snippets.

@jstanley23
Last active July 18, 2018 20:48
Show Gist options
  • Save jstanley23/29fbf9c1e493addc0ac4826d4132e26f to your computer and use it in GitHub Desktop.
Save jstanley23/29fbf9c1e493addc0ac4826d4132e26f to your computer and use it in GitHub Desktop.
--- 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