You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Get the percent usage only when there is a separate logs partition
360
+
if (fs_output.split()[0] !=log_fs_output.split()[0]):
361
+
percentage=log_fs_output.split()[4]
362
+
# remove % character and convert to float
363
+
returnfloat(percentage[0:-1])/100.0
364
+
else:
365
+
returnfloat('NaN')
366
+
353
367
defget_percent_fs_usage(ignored):
354
368
"Get the percent usage of the host filesystem. Input list is ignored and should be empty"
355
369
# this file is on the filesystem of interest in both OEM and Retail
356
370
output=commands.getoutput('df /etc/passwd')
357
371
output=' '.join(output.splitlines()[1:]) # remove header line and rewrap on single line
358
372
percentage=output.split()[4]
359
-
# strip of % character and convert to float
373
+
# remove % character and convert to float
360
374
returnfloat(percentage[0:-1])/100.0
361
375
362
376
defget_percent_mem_usage(ignored):
@@ -643,7 +657,7 @@ class VMMonitor(ObjectMonitor):
643
657
* alarm_trigger_period: num seconds of 'bad' values before an alarm is sent (default '60')
644
658
* alarm_auto_inhibit_period: num seconds this alarm disabled after an alarm is sent (default '3600')
645
659
* consolidation_fn: how to combine variables from rrd_updates into one value
646
-
(default is 'average' for 'cpu_usage', 'get_percent_fs_usage' for 'fs_usage', 'get_percent_mem_usage' for 'mem_usage', & 'sum' for everything else)
660
+
(default is 'average' for 'cpu_usage', 'get_percent_fs_usage' for 'fs_usage', 'get_percent_log_fs_usage' for 'log_fs_usage', 'get_percent_mem_usage' for 'mem_usage', & 'sum' for everything else)
647
661
* rrd_regex matches the names of variables from (xe vm-data-sources-list uuid=$vmuuid) used to compute value
648
662
(only has defaults for "cpu_usage", "network_usage", and "disk_usage")
649
663
"""
@@ -657,19 +671,22 @@ class VMMonitor(ObjectMonitor):
0 commit comments