mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* re-add it * add cape app page * add initial cape graphs * now work for the general page * more udpates * add cape pending * add pending and cleanup for if there are no packages(likely cuckoo, so don't add extra items) * rework the lack of packages a bit more * more cuckoo related cleanupgiot * fix cape error logging * minor cleanups * add a new graph and use it with cape... also lots of cape cleanups * misc cape updates * add percentile values for stats * add fix for weekly * don't display 1 day average if under 17 hours * zero timeslots of packages not used for this time slot * add avg stat graphs for cape * now use the average graphs and update the app page * add a new graph * add CAPEv2 docs * add tests data * lots of style cleanup * another tweak for the test data * fix misc style issues * add cape to apps page * add nicecase for cape * case fix * json fix for test data * add a missing stat * some more test data tweaking * more misc test updates * more test tweaking * more test work... * more test data work * add what is hopefully the final test tweak
71 lines
1.8 KiB
PHP
71 lines
1.8 KiB
PHP
<?php
|
|
|
|
$name = 'cape';
|
|
$app_id = $app['app_id'];
|
|
$unit_text = 'API Calls Per Run';
|
|
$colours = 'psychedelic';
|
|
$dostack = 0;
|
|
$printtotal = 1;
|
|
$addarea = 0;
|
|
$transparency = 15;
|
|
$float_precision = 3;
|
|
|
|
if (isset($vars['stddev'])) {
|
|
if ($vars['stddev'] != 'on' and $vars['stddev'] != 'off') {
|
|
$vars['stddev'] = 'off';
|
|
}
|
|
} else {
|
|
$vars['stddev'] = 'off';
|
|
}
|
|
|
|
if (isset($vars['package'])) {
|
|
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app['app_id'], 'pkg-api_calls___-___', $vars['package']]);
|
|
} else {
|
|
$rrd_filename = Rrd::name($device['hostname'], ['app', $name, $app['app_id'], 'api_calls']);
|
|
}
|
|
|
|
$rrd_list = [];
|
|
if (Rrd::checkRrdExists($rrd_filename)) {
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'Min',
|
|
'ds' => 's0api_calls',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'Max',
|
|
'ds' => 's1api_calls',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'Mean',
|
|
'ds' => 's3api_calls',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'Median',
|
|
'ds' => 's4api_calls',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'Mode',
|
|
'ds' => 's5api_calls',
|
|
];
|
|
if ($vars['stddev'] == 'on') {
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'StdDev',
|
|
'ds' => 's7api_calls',
|
|
];
|
|
$rrd_list[] = [
|
|
'filename' => $rrd_filename,
|
|
'descr' => 'StdDevP',
|
|
'ds' => 's9api_calls',
|
|
];
|
|
}
|
|
} else {
|
|
d_echo('RRD "' . $rrd_filename . '" not found');
|
|
}
|
|
|
|
require 'includes/html/graphs/generic_multi_line.inc.php';
|