diff --git a/python3/bin/perfmon b/python3/bin/perfmon index 58be93284d7..c78c891f60d 100644 --- a/python3/bin/perfmon +++ b/python3/bin/perfmon @@ -940,11 +940,11 @@ class SRMonitor(ObjectMonitor): num seconds this alarm disabled after an alarm is sent (default '3600') * consolidation_fn: how to combine variables from rrd_updates into one value - (default is 'get_percent_sr_usage' for 'physical_utilistation', + (default is 'get_percent_sr_usage' for 'physical_utilisation', & 'sum' for everything else) * rrd_regex matches the names of variables from (xe sr-data-sources-list uuid=$sruuid) used to compute value - (has default for "physical_utilistaion") + (has default for "physical_utilisation") """ def __init__(self, *args): @@ -975,7 +975,7 @@ class SRMonitor(ObjectMonitor): elif config_tag == "alarm_auto_inhibit_period": return "3600" # 1 hour elif config_tag == "alarm_trigger_level": - if variable_name == "physical_utilistaion": + if variable_name == "physical_utilisation": return "0.8" # trigger when 80% full else: raise XmlConfigException( diff --git a/python3/tests/test_perfmon.py b/python3/tests/test_perfmon.py index c133a1171ac..98d99a14283 100644 --- a/python3/tests/test_perfmon.py +++ b/python3/tests/test_perfmon.py @@ -427,6 +427,14 @@ def test_process_rrd_updates(self, mock_xapisession): # get_percent_sr_usage([500, 6000]) self.assertAlmostEqual(monitor.variables[0].value, 0.08333333333333333) + def test_alarm_trigger_level_physical_utilisation(self, _mock_xapisession): + uuid = 'e1ae3f5d-4c8b-4575-bbb8-2af7e8a2c31e' + monitor = perfmon.SRMonitor(uuid) + result = monitor.get_default_variable_config( + variable_name = "physical_utilisation", + config_tag = "alarm_trigger_level", + ) + self.assertEqual(result, '0.8') class TestRRDUpdates(unittest.TestCase): '''Test Class RRDUpdates and RRDContentHandler'''