mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
move percentage colour mappings to function. make graphs for memory/storage match percentage colours (should we do this for others?)
git-svn-id: http://www.observium.org/svn/observer/trunk@2160 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -13,21 +13,24 @@ $rrd_options .= " COMMENT:' Size Free % Used\\n'";
|
||||
|
||||
$hostname = gethostbyid($storage['device_id']);
|
||||
|
||||
if ($iter=="1") { $colour="CC0000"; } elseif ($iter=="2") { $colour="008C00"; } elseif ($iter=="3") { $colour="4096EE"; }
|
||||
elseif ($iter=="4") { $colour="73880A"; } elseif ($iter=="5") { $colour="D01F3C"; } elseif ($iter=="6") { $colour="36393D"; }
|
||||
elseif ($iter=="7") { $colour="FF0084"; $iter = "0"; }
|
||||
$colour="CC0000";
|
||||
$colour_area="ffaaaa";
|
||||
|
||||
$descr = substr(str_pad($storage[storage_descr], 12),0,12);
|
||||
$descr = str_replace(":","\:",$descr);
|
||||
|
||||
$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 .= " LINE1.25:$storage[storage_id]perc#" . $colour . ":'$descr'";
|
||||
$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";
|
||||
$iter++;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user