Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -6,23 +6,24 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @copyright (C) Adam Armstrong
*
*/
if (is_numeric($vars['id']))
{
$storage = dbFetchRow("SELECT * FROM `storage` WHERE `storage_id` = ?", array($vars['id']));
if (!is_intnum($vars['id'])) {
return;
}
if (is_numeric($storage['device_id']) && ($auth || device_permitted($storage['device_id'])))
{
$device = device_by_id_cache($storage['device_id']);
$storage = dbFetchRow("SELECT * FROM `storage` WHERE `storage_id` = ?", [$vars['id']]);
if (is_numeric($storage['device_id']) && ($auth || device_permitted($storage['device_id']))) {
$device = device_by_id_cache($storage['device_id']);
$rrd_filename = get_rrd_path($device, "storage-" . strtolower($storage['storage_mib']) . "-" . $storage['storage_descr'] . ".rrd");
$title = generate_device_link($device);
$title .= " :: Storage :: " . rewrite_entity_name($storage['storage_descr'], 'storage');
$auth = TRUE;
}
$auth = TRUE;
$graph_title = device_name($device, TRUE);
$graph_title .= " :: Storage :: " . rewrite_entity_name($storage['storage_descr'], 'storage');
}
// EOF

View File

@ -4,16 +4,16 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @package observium
* @subpackage graphs
* @copyright (C) Adam Armstrong
*
*/
$scale_min = "0";
$scale_max = "100";
include($config['html_dir']."/includes/graphs/common.inc.php");
include($config['html_dir'] . "/includes/graphs/common.inc.php");
$rrd_options .= " -b 1024";
@ -21,7 +21,7 @@ $iter = "1";
$rrd_options .= " COMMENT:' Size Free % Used\\n'";
$colour = "CC0000";
$colour = "CC0000";
$colour_area = "ffaaaa";
$descr = rrdtool_escape(rewrite_entity_name($storage['storage_descr'], 'storage'), 12);
@ -42,32 +42,30 @@ $rrd_options .= " GPRINT:size:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:free:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:perc:LAST:%5.2lf%%\\n";
if ($vars['trend'])
{
$rrd_options .= " VDEF:slope=used,LSLSLOPE ";
$rrd_options .= " VDEF:cons=used,LSLINT ";
$rrd_options .= " CDEF:lsl2=used,POP,slope,COUNT,*,cons,+ ";
$rrd_options .= ' LINE1.25:lsl2#ff0000::dashes=2';
if ($vars['trend']) {
$rrd_options .= " VDEF:slope=used,LSLSLOPE ";
$rrd_options .= " VDEF:cons=used,LSLINT ";
$rrd_options .= " CDEF:lsl2=used,POP,slope,COUNT,*,cons,+ ";
$rrd_options .= ' LINE1.25:lsl2#ff0000::dashes=2';
}
if ($vars['previous'])
{
$descr = rrdtool_escape("Prev ".rewrite_entity_name($storage['storage_descr'], 'storage'), 12);
if ($vars['previous']) {
$descr = rrdtool_escape("Prev " . rewrite_entity_name($storage['storage_descr'], 'storage'), 12);
$colour = "99999999";
$colour_area = "66666666";
$colour = "99999999";
$colour_area = "66666666";
$rrd_options .= " DEF:usedX=$rrd_filename_escape:used:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " DEF:freeX=$rrd_filename_escape:free:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " SHIFT:usedX:$period";
$rrd_options .= " SHIFT:freeX:$period";
$rrd_options .= " CDEF:sizeX=usedX,freeX,+";
$rrd_options .= " CDEF:percX=usedX,sizeX,/,100,*";
$rrd_options .= " AREA:usedX#" . $colour_area . ":";
$rrd_options .= " LINE1.25:sizeX#" . $colour . ":'$descr'";
$rrd_options .= " GPRINT:sizeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:freeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:percX:LAST:%5.2lf%%\\n";
$rrd_options .= " DEF:usedX=$rrd_filename_escape:used:AVERAGE:start=" . $prev_from . ":end=" . $from;
$rrd_options .= " DEF:freeX=$rrd_filename_escape:free:AVERAGE:start=" . $prev_from . ":end=" . $from;
$rrd_options .= " SHIFT:usedX:$period";
$rrd_options .= " SHIFT:freeX:$period";
$rrd_options .= " CDEF:sizeX=usedX,freeX,+";
$rrd_options .= " CDEF:percX=usedX,sizeX,/,100,*";
$rrd_options .= " AREA:usedX#" . $colour_area . ":";
$rrd_options .= " LINE1.25:sizeX#" . $colour . ":'$descr'";
$rrd_options .= " GPRINT:sizeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:freeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:percX:LAST:%5.2lf%%\\n";
}
?>

View File

@ -4,16 +4,16 @@
*
* This file is part of Observium.
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @package observium
* @subpackage graphs
* @copyright (C) Adam Armstrong
*
*/
$scale_min = "0";
$scale_max = "100";
include($config['html_dir']."/includes/graphs/common.inc.php");
include($config['html_dir'] . "/includes/graphs/common.inc.php");
$rrd_options .= " -b 1024";
@ -21,7 +21,7 @@ $iter = "1";
$rrd_options .= " COMMENT:' Size Free % Used\\n'";
$colour = "CC0000";
$colour = "CC0000";
$colour_area = "ffaaaa";
$descr = rrdtool_escape(rewrite_entity_name($storage['storage_descr'], 'storage'), 12);
@ -40,32 +40,30 @@ $rrd_options .= " GPRINT:size:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:free:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:perc:LAST:%5.2lf%%\\n";
if ($vars['trend'])
{
$rrd_options .= " VDEF:slope=perc,LSLSLOPE ";
$rrd_options .= " VDEF:cons=perc,LSLINT ";
$rrd_options .= " CDEF:lsl2=perc,POP,slope,COUNT,*,cons,+ ";
$rrd_options .= ' LINE1.25:lsl2#ff0000::dashes=2';
if ($vars['trend']) {
$rrd_options .= " VDEF:slope=perc,LSLSLOPE ";
$rrd_options .= " VDEF:cons=perc,LSLINT ";
$rrd_options .= " CDEF:lsl2=perc,POP,slope,COUNT,*,cons,+ ";
$rrd_options .= ' LINE1.25:lsl2#ff0000::dashes=2';
}
if ($vars['previous'])
{
$descr = rrdtool_escape("Prev ".rewrite_entity_name($storage['storage_descr'], 'storage'), 12);
if ($vars['previous']) {
$descr = rrdtool_escape("Prev " . rewrite_entity_name($storage['storage_descr'], 'storage'), 12);
$colour = "99999999";
$colour_area = "66666666";
$colour = "99999999";
$colour_area = "66666666";
$rrd_options .= " DEF:usedX=$rrd_filename_escape:used:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " DEF:freeX=$rrd_filename_escape:free:AVERAGE:start=".$prev_from.":end=".$from;
$rrd_options .= " SHIFT:usedX:$period";
$rrd_options .= " SHIFT:freeX:$period";
$rrd_options .= " CDEF:sizeX=usedX,freeX,+";
$rrd_options .= " CDEF:percX=usedX,sizeX,/,100,*";
$rrd_options .= " AREA:percX#" . $colour_area . ":";
$rrd_options .= " LINE1.25:percX#" . $colour . ":'$descr'";
$rrd_options .= " GPRINT:sizeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:freeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:percX:LAST:%5.2lf%%\\n";
$rrd_options .= " DEF:usedX=$rrd_filename_escape:used:AVERAGE:start=" . $prev_from . ":end=" . $from;
$rrd_options .= " DEF:freeX=$rrd_filename_escape:free:AVERAGE:start=" . $prev_from . ":end=" . $from;
$rrd_options .= " SHIFT:usedX:$period";
$rrd_options .= " SHIFT:freeX:$period";
$rrd_options .= " CDEF:sizeX=usedX,freeX,+";
$rrd_options .= " CDEF:percX=usedX,sizeX,/,100,*";
$rrd_options .= " AREA:percX#" . $colour_area . ":";
$rrd_options .= " LINE1.25:percX#" . $colour . ":'$descr'";
$rrd_options .= " GPRINT:sizeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:freeX:LAST:%6.2lf%sB";
$rrd_options .= " GPRINT:percX:LAST:%5.2lf%%\\n";
}
?>