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

@ -5,61 +5,61 @@
*/
// Array of paths when collectd's rrdtool plugin writes RRDs
$config['datadirs'] = array($config['collectd_dir']);
$config['datadirs'] = [$config['collectd_dir']];
// Width of graph to be generated by rrdgraph
if(isset($_GET['width'])) {
$config['rrd_width'] = $_GET['width'];
if (isset($_GET['width'])) {
$config['rrd_width'] = $_GET['width'];
} else {
$config['rrd_width'] = 270;
$config['rrd_width'] = 270;
}
// Height of graph to be generated by rrdgraph
if(isset($_GET['height'])) {
$config['rrd_height'] = $_GET['height'];
if (isset($_GET['height'])) {
$config['rrd_height'] = $_GET['height'];
} else {
$config['rrd_height'] = 120;
$config['rrd_height'] = 120;
}
// List of supported timespans (used for period drop-down list)
$config['timespan'] = array(
array('name'=>'hour', 'label'=>'past hour', 'seconds'=>3600),
array('name'=>'day', 'label'=>'past day', 'seconds'=>86400),
array('name'=>'week', 'label'=>'past week', 'seconds'=>604800),
array('name'=>'month', 'label'=>'past month', 'seconds'=>2678400),
array('name'=>'year', 'label'=>'past year', 'seconds'=>31622400));
$config['timespan'] = [
['name' => 'hour', 'label' => 'past hour', 'seconds' => 3600],
['name' => 'day', 'label' => 'past day', 'seconds' => 86400],
['name' => 'week', 'label' => 'past week', 'seconds' => 604800],
['name' => 'month', 'label' => 'past month', 'seconds' => 2678400],
['name' => 'year', 'label' => 'past year', 'seconds' => 31622400]];
// Interval at which values are collectd (currently ignored)
$config['rrd_interval'] = 10;
$config['rrd_interval'] = 10;
// Average rows/rra (currently ignored)
$config['rrd_rows'] = 2400;
$config['rrd_rows'] = 2400;
// Additional options to pass to rrdgraph
#$config['rrd_opts'] = (isset($config['rrdgraph_defaults']) ? $config['rrdgraph_defaults'] : '');
#$config['rrd_opts'] = array('-E', "-c", "SHADEA#a5a5a5", "-c", "SHADEB#a5a5a5", "-c", "FONT#000000", "-c", "CANVAS#FFFFFF", "-c", "GRID#aaaaaa",
# "-c", "MGRID#FFAAAA", "-c", "FRAME#3e3e3e", "-c", "ARROW#5e5e5e", "-R", "normal");
// Predefined set of colors for use by collectd_draw_rrd()
$config['rrd_colors'] = array(
'h_1'=>'F7B7B7', 'f_1'=>'FF0000', // Red
'h_2'=>'B7EFB7', 'f_2'=>'00E000', // Green
'h_3'=>'B7B7F7', 'f_3'=>'0000FF', // Blue
'h_4'=>'F3DFB7', 'f_4'=>'F0A000', // Yellow
'h_5'=>'B7DFF7', 'f_5'=>'00A0FF', // Cyan
'h_6'=>'DFB7F7', 'f_6'=>'A000FF', // Magenta
'h_7'=>'FFC782', 'f_7'=>'FF8C00', // Orange
'h_8'=>'DCFF96', 'f_8'=>'AAFF00', // Lime
'h_9'=>'83FFCD', 'f_9'=>'00FF99',
'h_10'=>'81D9FF', 'f_10'=>'00B2FF',
'h_11'=>'FF89F5', 'f_11'=>'FF00EA',
'h_12'=>'FF89AE', 'f_12'=>'FF0051',
'h_13'=>'BBBBBB', 'f_13'=>'555555',
);
$config['rrd_colors'] = [
'h_1' => 'F7B7B7', 'f_1' => 'FF0000', // Red
'h_2' => 'B7EFB7', 'f_2' => '00E000', // Green
'h_3' => 'B7B7F7', 'f_3' => '0000FF', // Blue
'h_4' => 'F3DFB7', 'f_4' => 'F0A000', // Yellow
'h_5' => 'B7DFF7', 'f_5' => '00A0FF', // Cyan
'h_6' => 'DFB7F7', 'f_6' => 'A000FF', // Magenta
'h_7' => 'FFC782', 'f_7' => 'FF8C00', // Orange
'h_8' => 'DCFF96', 'f_8' => 'AAFF00', // Lime
'h_9' => '83FFCD', 'f_9' => '00FF99',
'h_10' => '81D9FF', 'f_10' => '00B2FF',
'h_11' => 'FF89F5', 'f_11' => 'FF00EA',
'h_12' => 'FF89AE', 'f_12' => 'FF0051',
'h_13' => 'BBBBBB', 'f_13' => '555555',
];
/*
* URL to collectd's unix socket (unixsock plugin)
* enabled: 'unix:///var/run/collectd/collectd-unixsock'
* disabled: null
*/
$config['collectd_sock'] = null;
$config['collectd_sock'] = NULL;
/*
* Path to TTF font file to use in error images
* (fallback when file does not exist is GD fixed font)
*/
$config['error_font'] = '/usr/share/fonts/corefonts/arial.ttf';
$config['error_font'] = '/usr/share/fonts/corefonts/arial.ttf';
/*
* Constant defining full path to rrdtool

View File

@ -16,64 +16,69 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
function load_graph_definitions_local($logarithmic = false, $tinylegend = false) {
global $GraphDefs, $MetaGraphDefs;
function load_graph_definitions_local($logarithmic = FALSE, $tinylegend = FALSE)
{
global $GraphDefs, $MetaGraphDefs;
// Define 1-rrd Graph definitions here
$GraphDefs['local_type'] = array(
'-v', 'Commits',
'DEF:avg={file}:value:AVERAGE',
'DEF:min={file}:value:MIN',
'DEF:max={file}:value:MAX',
"AREA:max#B7B7F7",
"AREA:min#FFFFFF",
"LINE1:avg#0000FF:Commits",
'GPRINT:min:MIN:%6.1lf Min,',
'GPRINT:avg:AVERAGE:%6.1lf Avg,',
'GPRINT:max:MAX:%6.1lf Max,',
'GPRINT:avg:LAST:%6.1lf Last\l');
// Define 1-rrd Graph definitions here
$GraphDefs['local_type'] = [
'-v', 'Commits',
'DEF:avg={file}:value:AVERAGE',
'DEF:min={file}:value:MIN',
'DEF:max={file}:value:MAX',
"AREA:max#B7B7F7",
"AREA:min#FFFFFF",
"LINE1:avg#0000FF:Commits",
'GPRINT:min:MIN:%6.1lf Min,',
'GPRINT:avg:AVERAGE:%6.1lf Avg,',
'GPRINT:max:MAX:%6.1lf Max,',
'GPRINT:avg:LAST:%6.1lf Last\l'];
// Define MetaGraph definition type -> function mappings here
$MetaGraphDefs['local_meta'] = 'meta_graph_local';
// Define MetaGraph definition type -> function mappings here
$MetaGraphDefs['local_meta'] = 'meta_graph_local';
}
function meta_graph_local($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) {
global $config;
$sources = array();
function meta_graph_local($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
{
global $config;
$sources = [];
$title = "$host/$plugin".(!is_null($plugin_instance) ? "-$plugin_instance" : '')."/$type";
if (!isset($opts['title']))
$opts['title'] = $title;
$opts['rrd_opts'] = array('-v', 'Events');
$title = "$host/$plugin" . (!is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
if (!isset($opts['title'])) {
$opts['title'] = $title;
}
$opts['rrd_opts'] = ['-v', 'Events'];
$files = array();
/* $opts['colors'] = array(
'ham' => '00e000',
'spam' => '0000ff',
'malware' => '990000',
$files = [];
/* $opts['colors'] = array(
'ham' => '00e000',
'spam' => '0000ff',
'malware' => '990000',
'sent' => '00e000',
'deferred' => 'a0e000',
'reject' => 'ff0000',
'bounced' => 'a00050'
);
'sent' => '00e000',
'deferred' => 'a0e000',
'reject' => 'ff0000',
'bounced' => 'a00050'
);
$type_instances = array('ham', 'spam', 'malware', 'sent', 'deferred', 'reject', 'bounced'); */
foreach ($type_instances as $inst) {
$file = '';
foreach ($config['datadirs'] as $datadir)
if (is_file($datadir.'/'.$title.'-'.$inst.'.rrd')) {
$file = $datadir.'/'.$title.'-'.$inst.'.rrd';
break;
}
if ($file == '')
continue;
$type_instances = array('ham', 'spam', 'malware', 'sent', 'deferred', 'reject', 'bounced'); */
foreach ($type_instances as $inst) {
$file = '';
foreach ($config['datadirs'] as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
$file = $datadir . '/' . $title . '-' . $inst . '.rrd';
break;
}
}
if ($file == '') {
continue;
}
$sources[] = array('name'=>$inst, 'file'=>$file);
}
$sources[] = ['name' => $inst, 'file' => $file];
}
// return collectd_draw_meta_stack($opts, $sources);
return collectd_draw_meta_line($opts, $sources);
return collectd_draw_meta_line($opts, $sources);
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff