def testAlertGeneratorMySQLDbSizePollerCriticalThreshold(self): self.config.AlertGenerator.mysqlDbSizePoller.soft = 5 self.config.AlertGenerator.mysqlDbSizePoller.critical = 10 self.config.AlertGenerator.mysqlDbSizePoller.pollInterval = 0.2 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = MySQLDbSizePoller ti.config = self.config.AlertGenerator.mysqlDbSizePoller ti.thresholdToTest = self.config.AlertGenerator.mysqlDbSizePoller.critical ti.level = self.config.AlertProcessor.critical.level ti.expected = 1 ti.thresholdDiff = 1 ti.testCase = self utils.doGenericValueBasedPolling(ti)
def testAlertGeneratorCouchDbSizePollerNoAlert(self): self.config.AlertGenerator.couchDbSizePoller.couchURL = os.getenv("COUCHURL", None) self.config.AlertGenerator.couchDbSizePoller.soft = 5 self.config.AlertGenerator.couchDbSizePoller.critical = 10 self.config.AlertGenerator.couchDbSizePoller.pollInterval = 0.2 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = CouchDbSizePoller ti.config = self.config.AlertGenerator.couchDbSizePoller ti.thresholdToTest = self.config.AlertGenerator.couchDbSizePoller.soft - 3 ti.expected = 0 ti.thresholdDiff = 2 ti.testCase = self utils.doGenericValueBasedPolling(ti)
def testMySQLCPUPollerCriticalThreshold(self): self.config.AlertGenerator.mysqlCPUPoller.soft = 70 self.config.AlertGenerator.mysqlCPUPoller.critical = 80 self.config.AlertGenerator.mysqlCPUPoller.pollInterval = 0.2 self.config.AlertGenerator.mysqlCPUPoller.period = 1 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = MySQLCPUPoller ti.config = self.config.AlertGenerator.mysqlCPUPoller ti.thresholdToTest = self.config.AlertGenerator.mysqlCPUPoller.critical ti.level = self.config.AlertProcessor.critical.level ti.expected = 1 ti.thresholdDiff = 10 ti.testCase = self utils.doGenericPeriodAndProcessPolling(ti)
def testAlertGeneratorMySQLDbSizePollerNoAlert(self): self.config.AlertGenerator.mysqlDbSizePoller.soft = 5 self.config.AlertGenerator.mysqlDbSizePoller.critical = 10 self.config.AlertGenerator.mysqlDbSizePoller.pollInterval = 0.2 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = MySQLDbSizePoller ti.config = self.config.AlertGenerator.mysqlDbSizePoller # lower the threshold so that the alert is never generated ti.thresholdToTest = self.config.AlertGenerator.mysqlDbSizePoller.soft - 3 ti.level = 0 ti.expected = 0 ti.thresholdDiff = 2 ti.testCase = self utils.doGenericValueBasedPolling(ti)
def testAlertGeneratorCouchErrorsPollerNoAlert(self): self.config.AlertGenerator.couchErrorsPoller.couchURL = os.getenv("COUCHURL", None) self.config.AlertGenerator.couchErrorsPoller.soft = 100 self.config.AlertGenerator.couchErrorsPoller.critical = 200 # shall expect corresponding number of generated alerts for each observable value self.config.AlertGenerator.couchErrorsPoller.observables = (5, 6, 7) self.config.AlertGenerator.couchErrorsPoller.pollInterval = 0.2 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = CouchErrorsPoller ti.config = self.config.AlertGenerator.couchErrorsPoller ti.thresholdToTest = self.config.AlertGenerator.couchErrorsPoller.soft - 30 ti.expected = 0 ti.thresholdDiff = 20 ti.testCase = self utils.doGenericValueBasedPolling(ti)
def testAlertGeneratorCouchMemoryPollerCriticalThreshold(self): self.config.AlertGenerator.couchMemPoller.couchURL = os.getenv("COUCHURL", None) self.config.AlertGenerator.couchMemPoller.soft = 70 self.config.AlertGenerator.couchMemPoller.critical = 80 self.config.AlertGenerator.couchMemPoller.pollInterval = 0.2 self.config.AlertGenerator.couchMemPoller.period = 1 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = CouchMemoryPoller ti.config = self.config.AlertGenerator.couchMemPoller ti.thresholdToTest = self.config.AlertGenerator.couchMemPoller.critical ti.level = self.config.AlertProcessor.critical.level ti.expected = 1 ti.thresholdDiff = 10 ti.testCase = self utils.doGenericPeriodAndProcessPolling(ti)
def _doPeriodPoller(self, thresholdToTest, level, config, pollerClass, expected=0): ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = pollerClass ti.config = config ti.thresholdToTest = thresholdToTest ti.level = level ti.expected = expected ti.thresholdDiff = 10 ti.testCase = self utils.doGenericPeriodAndProcessPolling(ti)
def testMySQLMemoryPollerNoAlert(self): self.config.AlertGenerator.mysqlMemPoller.soft = 70 self.config.AlertGenerator.mysqlMemPoller.critical = 80 self.config.AlertGenerator.mysqlMemPoller.pollInterval = 0.2 self.config.AlertGenerator.mysqlMemPoller.period = 1 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = MySQLMemoryPoller ti.config = self.config.AlertGenerator.mysqlMemPoller # lower the threshold so that the alert is never generated ti.thresholdToTest = self.config.AlertGenerator.mysqlMemPoller.soft - 20 ti.level = 0 ti.expected = 0 ti.thresholdDiff = 10 ti.testCase = self utils.doGenericPeriodAndProcessPolling(ti)
def testAlertGeneratorCouchCPUPollerNoAlert(self): self.config.AlertGenerator.couchCPUPoller.couchURL = os.getenv("COUCHURL", None) self.config.AlertGenerator.couchCPUPoller.soft = 70 self.config.AlertGenerator.couchCPUPoller.critical = 80 self.config.AlertGenerator.couchCPUPoller.pollInterval = 0.2 self.config.AlertGenerator.couchCPUPoller.period = 1 ti = utils.TestInput() # see attributes comments at the class ti.pollerClass = CouchCPUPoller ti.config = self.config.AlertGenerator.couchCPUPoller # lower the threshold so that the alert is never generated ti.thresholdToTest = self.config.AlertGenerator.couchCPUPoller.soft - 20 ti.level = 0 ti.expected = 0 ti.thresholdDiff = 10 ti.testCase = self utils.doGenericPeriodAndProcessPolling(ti)