2022-10-30 12:18:02 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
$name = 'systemd';
|
|
|
|
|
$colours = 'psychedelic';
|
|
|
|
|
$scale_min = 0;
|
|
|
|
|
$polling_type = 'app';
|
|
|
|
|
$unit_text = 'Units';
|
|
|
|
|
$unitlen = 5;
|
|
|
|
|
$bigdescrlen = 20;
|
|
|
|
|
$smalldescrlen = 20;
|
|
|
|
|
|
|
|
|
|
$rrd_list = [];
|
|
|
|
|
|
2024-03-04 14:58:28 -08:00
|
|
|
if (! $rrdArray) {
|
|
|
|
|
graph_error('No Data to Display', 'No Data');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$i = 0;
|
2022-10-30 12:18:02 -07:00
|
|
|
foreach (array_keys($rrdArray) as $state_type) {
|
2024-03-04 14:58:28 -08:00
|
|
|
$shared_rrd_filename = Rrd::name($device['hostname'], [
|
2022-10-30 12:18:02 -07:00
|
|
|
$polling_type,
|
|
|
|
|
$name,
|
|
|
|
|
$app->app_id,
|
|
|
|
|
$state_type,
|
|
|
|
|
]);
|
|
|
|
|
|
2024-04-27 07:47:41 -04:00
|
|
|
if (Rrd::checkRrdExists($shared_rrd_filename)) {
|
2024-03-04 14:58:28 -08:00
|
|
|
foreach ($rrdArray[$state_type] as $state_status => $state_status_aa) {
|
|
|
|
|
if ($state_status_aa['rrd_location'] === 'individual') {
|
|
|
|
|
$individual_rrd_filename = Rrd::name($device['hostname'], [
|
|
|
|
|
$polling_type,
|
|
|
|
|
$name,
|
|
|
|
|
$app->app_id,
|
|
|
|
|
$state_type,
|
|
|
|
|
$state_status,
|
|
|
|
|
]);
|
|
|
|
|
$rrd_list[$i]['filename'] = $individual_rrd_filename;
|
|
|
|
|
} else {
|
|
|
|
|
$rrd_list[$i]['filename'] = $shared_rrd_filename;
|
|
|
|
|
}
|
|
|
|
|
$rrd_list[$i]['descr'] = $state_status_aa['descr'];
|
2022-10-30 12:18:02 -07:00
|
|
|
$rrd_list[$i]['ds'] = $state_status;
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-04-27 07:47:41 -04:00
|
|
|
graph_error('No Data file ' . basename($shared_rrd_filename), 'No Data');
|
2022-10-30 12:18:02 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
require 'includes/html/graphs/generic_multi_line_exact_numbers.inc.php';
|