add HV Monitor, a generic means for monitoring hypvervisors (#14218)

* add HV::Monitor support

* document hv monitor

* add HV Monitor tests

* style cleanup

* fix a few missed style items

* test fix

* more test cleanup

* more minor test tweaks

* more test cleanup

* more test tweaking

* test ordering fix all done... hopefully

* more test cleanup

* minor formatting change
This commit is contained in:
Zane C. Bowers-Hadley
2022-11-07 13:35:48 -06:00
committed by GitHub
parent 9d3d81bb11
commit 8511611f64
33 changed files with 3751 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
$name = 'hv-monitor';
$unit_text = 'Memory Usage %';
$colours = 'psychedelic';
$dostack = 0;
$printtotal = 0;
$addarea = 0;
$transparency = 15;
if (isset($vars['vm'])) {
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id, 'vm', $vars['vm']]);
} else {
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app->app_id]);
}
$rrd_list = [];
if (Rrd::checkRrdExists($rrd_filename)) {
$rrd_list[] = [
'filename' => $rrd_filename,
'descr' => 'CPU%',
'ds' => 'pcpu',
];
} else {
d_echo('RRD "' . $rrd_filename . '" not found');
}
require 'includes/html/graphs/generic_multi_line.inc.php';