mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
fix some of the mysql graphs (boring!)
git-svn-id: http://www.observium.org/svn/observer/trunk@2535 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,70 +1,37 @@
|
||||
<?php
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
include('includes/graphs/common.inc.php');
|
||||
|
||||
$mysql_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-mysql-".$app['app_id'].".rrd";
|
||||
$rrd_filename = $config["rrd_dir"] . '/' . $device["hostname"] . '/app-mysql-'.$app["app_id"].'.rrd';
|
||||
|
||||
if (is_file($mysql_rrd))
|
||||
$array = array('CDe' => array('descr' => 'Delete', 'colour' => '22FF22'),
|
||||
'CIt' => array('descr' => 'Insert', 'colour' => '0022FF'),
|
||||
'CISt' => array('descr' => 'Insert Select', 'colour' => 'FF0000'),
|
||||
'CLd' => array('descr' => 'Load Data', 'colour' => '00AAAA'),
|
||||
'CRe' => array('descr' => 'Replace', 'colour' => 'FF00FF'),
|
||||
'CRSt' => array('descr' => 'Replace Select', 'colour' => 'FFA500'),
|
||||
'CSt' => array('descr' => 'Select', 'colour' => 'CC0000'),
|
||||
'CUe' => array('descr' => 'Update', 'colour' => '0000CC'),
|
||||
'CUMi' => array('descr' => 'Update Multiple', 'colour' => '0080C0'),
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
if (is_file($rrd_filename))
|
||||
{
|
||||
$rrd_filename = $mysql_rrd;
|
||||
}
|
||||
foreach ($array as $ds => $vars)
|
||||
{
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $vars['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
# $rrd_list[$i]['colour'] = $vars['colour'];
|
||||
$i++;
|
||||
}
|
||||
} else { echo("file missing: $file"); }
|
||||
|
||||
$rrd_options .= ' -b 1024 ';
|
||||
$rrd_options .= ' DEF:a='.$rrd_filename.':CDe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:b='.$rrd_filename.':CIt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:c='.$rrd_filename.':CISt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:d='.$rrd_filename.':CLd:AVERAGE ';
|
||||
$rrd_options .= ' DEF:e='.$rrd_filename.':CRe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:f='.$rrd_filename.':CRSt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:g='.$rrd_filename.':CSt:AVERAGE ';
|
||||
$rrd_options .= ' DEF:h='.$rrd_filename.':CUe:AVERAGE ';
|
||||
$rrd_options .= ' DEF:i='.$rrd_filename.':CUMi:AVERAGE ';
|
||||
$colours = "mixed";
|
||||
$nototal = 1;
|
||||
$unit_text = "Commands";
|
||||
|
||||
$rrd_options .= 'COMMENT:" Current Average Maximum\n" ';
|
||||
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
|
||||
|
||||
$rrd_options .= "AREA:a#22FF22:Delete\ \ ";
|
||||
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:b#0022FF:"Insert ":STACK ';
|
||||
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:c#FF0000:"Insert Select":STACK ';
|
||||
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:d#00AAAA:"Load Data":STACK ';
|
||||
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:e#FF00FF:"Replace ":STACK ';
|
||||
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:f#FFA500:"Replace Select":STACK ';
|
||||
$rrd_options .= 'GPRINT:f:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:f:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:g#CC0000:"Select ":STACK ';
|
||||
$rrd_options .= 'GPRINT:g:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:g:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:g:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:h#0000CC:"Update ":STACK ';
|
||||
$rrd_options .= 'GPRINT:h:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:h:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:h:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
$rrd_options .= 'AREA:i#0080C0:"Update Multi":STACK ';
|
||||
$rrd_options .= 'GPRINT:i:LAST:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:i:AVERAGE:"%6.2lf %s" ';
|
||||
$rrd_options .= 'GPRINT:i:MAX:"%6.2lf %s\n" ';
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user