mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixing some graphing bits
git-svn-id: http://www.observium.org/svn/observer/trunk@218 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -28,6 +28,7 @@ while($device = mysql_fetch_array($sql)){
|
||||
echo("<div style='border: solid 2px #d0D0D0; float: left; padding: 5px; width: 120px; height: 90px; background: #ffbbbb; margin: 4px;'>
|
||||
<center><strong>".generatedevicelink($device, shorthost($device['hostname']))."</strong><br />
|
||||
<span style='font-size: 14px; font-weight: bold; margin: 5px; color: #c00;'>Device Down</span>
|
||||
|
||||
<span class=body-date-1>".truncate($device['location'], 20)."</span>
|
||||
</center></div>");
|
||||
|
||||
@@ -39,6 +40,7 @@ while($interface = mysql_fetch_array($sql)){
|
||||
|
||||
generate_front_box("warn", "<center><strong>".generatedevicelink($interface, shorthost($interface['hostname']))."</strong><br />
|
||||
<span style='font-size: 14px; font-weight: bold; margin: 5px; color: #c00;'>Port Down</span>
|
||||
<!-- <img src='graph.php?type=bits&if=".$interface['interface_id']."&from=$day&to=$now&width=100&height=32' /> -->
|
||||
<strong>".generateiflink($interface, makeshortif($interface['ifDescr']))."</strong> <br />
|
||||
<span class=body-date-1>".truncate($interface['ifAlias'], 20)."</span>
|
||||
</center>");
|
||||
|
||||
@@ -137,6 +137,7 @@ function graph_device_bits ($device, $graph, $from, $to, $width, $height) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end " . ($to - 150) . " --width $width --height $height ";
|
||||
if($height < "33") { $options .= " --only-graph"; }
|
||||
$hostname = gethostbyid($device);
|
||||
$query = mysql_query("SELECT `ifIndex` FROM `interfaces` WHERE `device_id` = '$device' AND `ifType` NOT LIKE '%oopback%' AND `ifType` NOT LIKE '%SVI%' AND `ifType` != 'l2vlan'");
|
||||
if($width <= "300") { $options .= "--font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
@@ -179,6 +180,7 @@ function trafgraph ($rrd, $graph, $from, $to, $width, $height) {
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
if($height < "33") { $options .= " --only-graph"; }
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
$options .= " DEF:inoctets=$database:INOCTETS:AVERAGE";
|
||||
$options .= " DEF:outoctets=$database:OUTOCTETS:AVERAGE";
|
||||
@@ -316,7 +318,7 @@ function cpugraph ($rrd, $graph , $from, $to, $width, $height) {
|
||||
global $config, $rrdtool, $installdir, $mono_font;
|
||||
$database = $config['rrd_dir'] . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
$options = "--alt-autoscale-max -l 0 -E --start $from --end $to --width $width --height $height ";
|
||||
if($width <= "300") {$options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
$options .= " DEF:5s=$database:LOAD5S:AVERAGE";
|
||||
$options .= " DEF:5m=$database:LOAD5M:AVERAGE";
|
||||
@@ -351,7 +353,7 @@ function memgraph ($rrd, $graph , $from, $to, $width, $height, $title, $vertical
|
||||
$database = $config['rrd_dir'] . "/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$period = $to - $from;
|
||||
$options = "--alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
$options = "-l 0 --alt-autoscale-max -E --start $from --end $to --width $width --height $height ";
|
||||
if($width <= "300") { $options .= " --font LEGEND:7:$mono_font --font AXIS:6:$mono_font --font-render-mode normal "; }
|
||||
$options .= " DEF:MEMTOTAL=$database:MEMTOTAL:AVERAGE";
|
||||
$options .= " DEF:IOFREE=$database:IOFREE:AVERAGE";
|
||||
|
||||
Reference in New Issue
Block a user