@@ -404,7 +404,7 @@ class VariableConfig:
404404 try :
405405 self .alarm_trigger_period = int (alarm_trigger_period )
406406 except :
407- raise XmlConfigException , "variable %s: alarm_trigger_level %s not an int" % \
407+ raise XmlConfigException , "variable %s: alarm_trigger_period %s not an int" % \
408408 (name , alarm_trigger_period )
409409
410410 try :
@@ -655,7 +655,7 @@ class HOSTMonitor(ObjectMonitor):
655655 * consolidation_fn: how to combine variables from rrd_updates into one value
656656 (default is 'average' for 'cpu_usage' & 'sum' for everything else)
657657 * rrd_regex matches the names of variables from (xe host-data-source-list uuid=$hostuuid) used to compute value
658- (only has defaults for "cpu_usage", "network_usage", "memory_total_kib " and "sr_io_throughput_total_xxxxxxxx")
658+ (only has defaults for "cpu_usage", "network_usage", "memory_free_kib " and "sr_io_throughput_total_xxxxxxxx")
659659 """
660660 def __init__ (self , * args ):
661661 self .monitortype = "Host"
@@ -670,12 +670,14 @@ class HOSTMonitor(ObjectMonitor):
670670 elif config_tag == 'rrd_regex' :
671671 if variable_name == "cpu_usage" : return "cpu[0-9]+"
672672 elif variable_name == "network_usage" : return "pif_eth[0-9]+_[rt]x"
673- elif variable_name == "memory_total_kib " : return variable_name
673+ elif variable_name == "memory_free_kib " : return variable_name
674674 elif re .match ("sr_io_throughput_total_[0-9a-f]{8}$" , variable_name ): return variable_name [3 :]
675675 else : raise XmlConfigException , "variable %s: no default rrd_regex - please specify one" % variable_name
676676 elif config_tag == 'alarm_trigger_period' : return '60' # 1 minute
677677 elif config_tag == 'alarm_auto_inhibit_period' : return '3600' # 1 hour
678- elif config_tag == 'alarm_trigger_sense' : return 'high' # trigger if *above*
678+ elif config_tag == 'alarm_trigger_sense' :
679+ if variable_name == "memory_free_kib" : return "low"
680+ else : return 'high' # trigger if *above* level
679681 elif config_tag == 'alarm_priority' : return '5' # the minimum priority required for mail-alarm to send
680682 else : raise XmlConfigException , "variable %s: no default available for tag %s" % (variable_name , config_tag )
681683
0 commit comments