mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2026-02-05 22:55:15 +01:00
Add flag to override URL unreachable state
- I refactored the Nagios helper a bit to integrate this functionality a bit simpler. Before we had distinct methods on the helper that added warn,crit,unko message, now there's a general method that takes an int as parameter. This way we avoid if-else structures for the new functionality.
This commit is contained in:
@@ -84,10 +84,10 @@ class UtilTest(unittest.TestCase):
|
||||
data = json.loads(jsondata)
|
||||
nagios = NagiosHelper()
|
||||
processor = JsonRuleProcessor(data, args)
|
||||
nagios.append_warning(processor.checkWarning())
|
||||
nagios.append_critical(processor.checkCritical())
|
||||
nagios.append_message(WARNING_CODE, processor.checkWarning())
|
||||
nagios.append_message(CRITICAL_CODE, processor.checkCritical())
|
||||
nagios.append_metrics(processor.checkMetrics())
|
||||
nagios.append_unknown(processor.checkUnknown())
|
||||
nagios.append_message(UNKNOWN_CODE, processor.checkUnknown())
|
||||
self.assertEqual(code, nagios.getCode())
|
||||
|
||||
def test_metrics(self):
|
||||
|
||||
Reference in New Issue
Block a user