File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -940,11 +940,11 @@ class SRMonitor(ObjectMonitor):
940940 num seconds this alarm disabled after an alarm is sent (default '3600')
941941 * consolidation_fn:
942942 how to combine variables from rrd_updates into one value
943- (default is 'get_percent_sr_usage' for 'physical_utilistation ',
943+ (default is 'get_percent_sr_usage' for 'physical_utilisation ',
944944 & 'sum' for everything else)
945945 * rrd_regex matches the names of variables
946946 from (xe sr-data-sources-list uuid=$sruuid) used to compute value
947- (has default for "physical_utilistaion ")
947+ (has default for "physical_utilisation ")
948948 """
949949
950950 def __init__ (self , * args ):
@@ -975,7 +975,7 @@ class SRMonitor(ObjectMonitor):
975975 elif config_tag == "alarm_auto_inhibit_period" :
976976 return "3600" # 1 hour
977977 elif config_tag == "alarm_trigger_level" :
978- if variable_name == "physical_utilistaion " :
978+ if variable_name == "physical_utilisation " :
979979 return "0.8" # trigger when 80% full
980980 else :
981981 raise XmlConfigException (
Original file line number Diff line number Diff line change @@ -427,6 +427,14 @@ def test_process_rrd_updates(self, mock_xapisession):
427427 # get_percent_sr_usage([500, 6000])
428428 self .assertAlmostEqual (monitor .variables [0 ].value , 0.08333333333333333 )
429429
430+ def test_alarm_trigger_level_physical_utilisation (self , _mock_xapisession ):
431+ uuid = 'e1ae3f5d-4c8b-4575-bbb8-2af7e8a2c31e'
432+ monitor = perfmon .SRMonitor (uuid )
433+ result = monitor .get_default_variable_config (
434+ variable_name = "physical_utilisation" ,
435+ config_tag = "alarm_trigger_level" ,
436+ )
437+ self .assertEqual (result , '0.8' )
430438
431439class TestRRDUpdates (unittest .TestCase ):
432440 '''Test Class RRDUpdates and RRDContentHandler'''
You can’t perform that action at this time.
0 commit comments