Skip to content

Commit 8385bb8

Browse files
committed
Slight correction and comment-update in perfmon
rrd_regex must match the whole data-source name, not just a substring Signed-off-by: Thomas Sanders <[email protected]>
1 parent f385f3d commit 8385bb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/perfmon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class VariableConfig:
392392

393393
self.name = name
394394
try:
395-
self.rrd_regex = re.compile(rrd_regex)
395+
self.rrd_regex = re.compile("^%s$" % rrd_regex)
396396
except:
397397
raise XmlConfigException, "variable %s: regex %s does not compile" % (name, rrd_regex)
398398

@@ -573,7 +573,7 @@ class ObjectMonitor:
573573
params_in_obj_report = obj_report.get_var_names()
574574
for var in self.variables:
575575
# find the subset of the params returned for this object that we need to consolidate into var
576-
params_to_consolidate = filter(var.rrd_regex.search, params_in_obj_report)
576+
params_to_consolidate = filter(var.rrd_regex.match, params_in_obj_report)
577577
for row in range(num_rows):
578578
# Get the values to consolidate
579579
values_to_consolidate = map(lambda param: obj_report.get_value(param, row), params_to_consolidate)
@@ -604,7 +604,7 @@ class VMMonitor(ObjectMonitor):
604604
* alarm_trigger_period: num seconds of 'bad' values before an alarm is sent (default '60')
605605
* alarm_auto_inhibit_period: num seconds this alarm disabled after an alarm is sent (default '3600')
606606
* consolidation_fn: how to combine variables from rrd_updates into one value
607-
(default is 'average' for 'cpu_usage' & 'sum' for everything else)
607+
(default is 'average' for 'cpu_usage', 'get_percent_fs_usage' for 'fs_usage', & 'sum' for everything else)
608608
* rrd_regex matches the names of variables from (xe vm-data-sources-list uuid=$vmuuid) used to compute value
609609
(only has defaults for "cpu_usage", "network_usage", and "disk_usage")
610610
"""

0 commit comments

Comments
 (0)