diff --git a/html/includes/graphs/device/cipsec_flow_tunnels.inc.php b/html/includes/graphs/device/cipsec_flow_tunnels.inc.php index 667c86663..e1e77f7a1 100644 --- a/html/includes/graphs/device/cipsec_flow_tunnels.inc.php +++ b/html/includes/graphs/device/cipsec_flow_tunnels.inc.php @@ -3,18 +3,13 @@ include("includes/graphs/common.inc.php"); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/cipsec_flow.rrd"; - $ds = "Tunnels"; - $colour_area = "9999cc"; $colour_line = "0000cc"; - $colour_area_max = "aaaaacc"; - $scale_min = 0; - $unit_text = "Active Tunnels"; include("includes/graphs/generic_simplex.inc.php"); -?> \ No newline at end of file +?> diff --git a/html/includes/graphs/device/mempool.inc.php b/html/includes/graphs/device/mempool.inc.php index 720791010..bfdd4b271 100644 --- a/html/includes/graphs/device/mempool.inc.php +++ b/html/includes/graphs/device/mempool.inc.php @@ -18,7 +18,7 @@ foreach (dbFetchRows("SELECT * FROM `mempools` where `device_id` = ?", array($id $descr = substr(str_pad(short_hrDeviceDescr($mempool['mempool_descr']), 22),0,22); $descr = str_replace(":", "\:", $descr); - $rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("mempool-".$mempool['mempool_type']."-".$mempool['mempool_index'].".rrd"); + $rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("mempoolX-".$mempool['mempool_type']."-".$mempool['mempool_index'].".rrd"); if (is_file($rrd_filename)) { diff --git a/html/includes/graphs/device/storage.inc.php b/html/includes/graphs/device/storage.inc.php index 3ddcca5b6..b323e1613 100644 --- a/html/includes/graphs/device/storage.inc.php +++ b/html/includes/graphs/device/storage.inc.php @@ -19,7 +19,7 @@ foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($id)) as $descr = substr(str_pad($storage[storage_descr], 12),0,12); $descr = str_replace(":","\:",$descr); - $rrd = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("storage-".$storage['storage_mib']."-".$storage['storage_descr'].".rrd"); + $rrd = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("storageX-".$storage['storage_mib']."-".$storage['storage_descr'].".rrd"); $rrd_options .= " DEF:$storage[storage_id]used=$rrd:used:AVERAGE"; $rrd_options .= " DEF:$storage[storage_id]free=$rrd:free:AVERAGE"; $rrd_options .= " CDEF:$storage[storage_id]size=$storage[storage_id]used,$storage[storage_id]free,+"; diff --git a/html/includes/graphs/generic_simplex.inc.php b/html/includes/graphs/generic_simplex.inc.php index b554f377d..2b839efe5 100644 --- a/html/includes/graphs/generic_simplex.inc.php +++ b/html/includes/graphs/generic_simplex.inc.php @@ -12,11 +12,14 @@ if ($multiplier) { $rrd_options .= " DEF:".$ds."_o=".$rrd_filename.":".$ds.":AVERAGE"; $rrd_options .= " DEF:".$ds."_max_o=".$rrd_filename.":".$ds.":MAX"; + $rrd_options .= " DEF:".$ds."_min_o=".$rrd_filename.":".$ds.":MIN"; $rrd_options .= " CDEF:".$ds."=".$ds."_o,$multiplier,*"; $rrd_options .= " CDEF:".$ds."_max=".$ds."_max_o,$multiplier,*"; + $rrd_options .= " CDEF:".$ds."_min=".$ds."_min_o,$multiplier,*"; } else { $rrd_options .= " DEF:".$ds."=".$rrd_filename.":".$ds.":AVERAGE"; $rrd_options .= " DEF:".$ds."_max=".$rrd_filename.":".$ds.":MAX"; + $rrd_options .= " DEF:".$ds."_min=".$rrd_filename.":".$ds.":MIN"; } if ($print_total) { @@ -27,10 +30,6 @@ if ($percentile) { $rrd_options .= " VDEF:".$ds."_percentile=".$ds.",".$percentile.",PERCENT"; } -if ($graph_max) -{ - $rrd_options .= " AREA:".$ds."_max#".$colour_area_max.":"; -} if($_GET['previous'] == "yes") { @@ -62,8 +61,19 @@ if($_GET['previous'] == "yes") # } } +if($colour_minmax) +{ + $rrd_options .= " AREA:".$ds."_max#c5c5c5"; + $rrd_options .= " AREA:".$ds."_min#ffffffff"; +} else { + $rrd_options .= " AREA:".$ds."#".$colour_area.":"; + if ($graph_max) + { + $rrd_options .= " AREA:".$ds."_max#".$colour_area_max.":"; + } +} + -$rrd_options .= " AREA:".$ds."#".$colour_area.":"; $rrd_options .= " COMMENT:'".$unit_text."Now Ave Max"; if ($percentile) diff --git a/html/includes/graphs/mempool/auth.inc.php b/html/includes/graphs/mempool/auth.inc.php index 03f35a93b..830719808 100755 --- a/html/includes/graphs/mempool/auth.inc.php +++ b/html/includes/graphs/mempool/auth.inc.php @@ -7,7 +7,7 @@ if (is_numeric($id)) if (is_numeric($mempool['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($mempool['device_id']))) { $device = device_by_id_cache($mempool['device_id']); - $rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("mempool-".$mempool['mempool_type']."-".$mempool['mempool_index'].".rrd"); + $rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("mempoolX-".$mempool['mempool_type']."-".$mempool['mempool_index'].".rrd"); $title = generate_device_link($device); $title .= " :: Memory Pool :: " . htmlentities($mempool['mempool_descr']); $auth = TRUE; diff --git a/html/includes/graphs/processor/usage.inc.php b/html/includes/graphs/processor/usage.inc.php index ba02668bf..3b8d317b0 100755 --- a/html/includes/graphs/processor/usage.inc.php +++ b/html/includes/graphs/processor/usage.inc.php @@ -1,11 +1,32 @@ \ No newline at end of file +} +?> diff --git a/html/includes/graphs/storage/auth.inc.php b/html/includes/graphs/storage/auth.inc.php index c2038c697..5b5b5119a 100755 --- a/html/includes/graphs/storage/auth.inc.php +++ b/html/includes/graphs/storage/auth.inc.php @@ -7,7 +7,7 @@ if (is_numeric($id)) if (is_numeric($storage['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($storage['device_id']))) { $device = device_by_id_cache($storage['device_id']); - $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("storage-" . $storage['storage_mib'] . "-" . $storage['storage_descr'] . ".rrd"); + $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("storageX-" . $storage['storage_mib'] . "-" . $storage['storage_descr'] . ".rrd"); $title = generate_device_link($device); $title .= " :: Storage :: " . htmlentities($storage['storage_descr']); diff --git a/html/includes/graphs/storage/usage.inc.php b/html/includes/graphs/storage/usage.inc.php index 715908439..8d65bc222 100644 --- a/html/includes/graphs/storage/usage.inc.php +++ b/html/includes/graphs/storage/usage.inc.php @@ -23,14 +23,34 @@ $percentage = round($storage['storage_perc'], 0); $background = get_percentage_colours($percentage); -$rrd_options .= " DEF:$storage[storage_id]used=$rrd_filename:used:AVERAGE"; -$rrd_options .= " DEF:$storage[storage_id]free=$rrd_filename:free:AVERAGE"; -$rrd_options .= " CDEF:$storage[storage_id]size=$storage[storage_id]used,$storage[storage_id]free,+"; -$rrd_options .= " CDEF:$storage[storage_id]perc=$storage[storage_id]used,$storage[storage_id]size,/,100,*"; -$rrd_options .= " AREA:$storage[storage_id]perc#" . $background['right'] . ":"; -$rrd_options .= " LINE1.25:$storage[storage_id]perc#" . $background['left'] . ":'$descr'"; -$rrd_options .= " GPRINT:$storage[storage_id]size:LAST:%6.2lf%sB"; -$rrd_options .= " GPRINT:$storage[storage_id]free:LAST:%6.2lf%sB"; -$rrd_options .= " GPRINT:$storage[storage_id]perc:LAST:%5.2lf%%\\\\n"; +$rrd_options .= " DEF:used=$rrd_filename:used:AVERAGE"; +$rrd_options .= " DEF:free=$rrd_filename:free:AVERAGE"; +$rrd_options .= " CDEF:size=used,free,+"; +$rrd_options .= " CDEF:perc=used,size,/,100,*"; +$rrd_options .= " AREA:perc#" . $background['right'] . ":"; +$rrd_options .= " LINE1.25:perc#" . $background['left'] . ":'$descr'"; +$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($_GET['previous']) +{ + $descr = substr(str_pad("Prev ".$storage[storage_descr], 12),0,12); + $descr = str_replace(":","\:",$descr); + + $colour="99999999"; + $colour_area="66666666"; + + $rrd_options .= " DEF:usedX=$rrd_filename:used:AVERAGE:start=".$prev_from.":end=".$from; + $rrd_options .= " DEF:freeX=$rrd_filename: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"; +} ?> diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 2ff152580..3824880ba 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -402,11 +402,11 @@ if ($_SESSION['userlevel'] >= '5' && ($app_count) > "0")