mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
docker stats app (#12358)
* docker stat app support * Add missing doc and app * stylci * styleci * styleci * Add test data * add snmpsim * Update docker.inc.php test with use Number::Bi * typo * Add tests * Add tests Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
36
includes/html/graphs/application/docker-common.inc.php
Normal file
36
includes/html/graphs/application/docker-common.inc.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
$name = 'docker';
|
||||
$app_id = $app['app_id'];
|
||||
$colours = 'mega';
|
||||
$dostack = 0;
|
||||
$printtotal = 0;
|
||||
$addarea = 1;
|
||||
$transparency = 15;
|
||||
|
||||
$unitlen = 20;
|
||||
$bigdescrlen = 25;
|
||||
$smalldescrlen = 25;
|
||||
|
||||
if (isset($vars['container'])) {
|
||||
$containers = [$vars['container']];
|
||||
} else {
|
||||
$containers = get_arrays_with_application($device, $app['app_id'], 'docker');
|
||||
}
|
||||
|
||||
$int = 0;
|
||||
while (isset($containers[$int])) {
|
||||
$container_name = $containers[$int];
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', $name, $app_id, $container_name]);
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
$rrd_list[] = [
|
||||
'filename' => $rrd_filename,
|
||||
'descr' => $container_name,
|
||||
'ds' => $rrdVar,
|
||||
];
|
||||
}
|
||||
$int++;
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line_exact_numbers.inc.php';
|
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$unit_text = 'CPU (%)';
|
||||
$rrdVar = 'cpu_usage';
|
||||
$divider = 100;
|
||||
|
||||
require 'docker-common.inc.php';
|
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
$unit_text = 'Memory Limit';
|
||||
$rrdVar = 'mem_limit';
|
||||
|
||||
require 'docker-common.inc.php';
|
7
includes/html/graphs/application/docker_mem_perc.inc.php
Normal file
7
includes/html/graphs/application/docker_mem_perc.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$unit_text = 'Memory (%)';
|
||||
$rrdVar = 'mem_perc';
|
||||
$divider = 100;
|
||||
|
||||
require 'docker-common.inc.php';
|
6
includes/html/graphs/application/docker_mem_used.inc.php
Normal file
6
includes/html/graphs/application/docker_mem_used.inc.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
$unit_text = 'Memory used';
|
||||
$rrdVar = 'mem_used';
|
||||
|
||||
require 'docker-common.inc.php';
|
6
includes/html/graphs/application/docker_pids.inc.php
Normal file
6
includes/html/graphs/application/docker_pids.inc.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
$unit_text = 'PIDs (count)';
|
||||
$rrdVar = 'pids';
|
||||
|
||||
require 'docker-common.inc.php';
|
Reference in New Issue
Block a user