Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)
Esempio n. 7
0
 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)
Esempio n. 8
0
 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)
Esempio n. 9
0
 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)